41

I recently created a project and added a splash and a main activity. I edited the manifest file and added the splash activity and the main activity in to it. After adding the main activity, it gives me a warning "Exported Activity Does not Require Permission". What is this warning that it gives me? my API version is android:15.

Please help, Thank you!

this is my manifest file!

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sliit.droidman"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" />

<application android:label="@string/app_name"
    android:icon="@drawable/ic_launcher"
    android:theme="@style/AppTheme">
    <activity
        android:name=".SplashActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>        
    <activity
        android:name="com.sliit.droidman.main.MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="com.sliit.droidman.main.MAINACTIVITY" />
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
</application>

</manifest>
2
  • Now I did try something. for the second activity, the warning was not given when I delete the category tag! I recently updated my android SDK too! Commented Jul 4, 2012 at 18:41
  • I think this happens only if you have two or more opened projects in your Eclipse. If you close all other projects and you clean workspace, you will lose those warnings. Commented Sep 1, 2012 at 18:08

3 Answers 3

75

add this to your activity definition

android:exported="false"
30

This warning means that your activities are exposed to different-process apps that might instantiate them without any required permission.

for details see: http://developer.android.com/guide/topics/manifest/activity-element.html http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn

1
  • 1
    and how to make it only my app instatiates them?
    – max4ever
    Commented Aug 29, 2012 at 11:15
26

It could be due to the <action android:name="com.sliit.droidman.main.MAINACTIVITY" />. I don't know why you add that intent filter?

You normally don't need an intent-filter for other normal activities.

2
  • 2
    I actually followed a youtube tutorial on creating a simple android app. In that, the tutor just noted to put an intent filter. he dint mention the reason. :( that's why I put the intent filter, nd now Iget that I really dnt need an intent filter for the component! :) I just went thru the android developer zone! :) thank you for your time! Commented Jul 4, 2012 at 18:45
  • 1
    When I remove intent-filter, the application force closed. When I re insert it, it works fine.. Why?
    – NewUser
    Commented Sep 4, 2012 at 6:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.