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>
Bob
  • 5,510
  • 9
  • 48
  • 80
Imesh Chandrasiri
  • 5,558
  • 15
  • 60
  • 103
  • 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! – Imesh Chandrasiri Jul 04 '12 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. – Ivan Ilijasic Sep 01 '12 at 18:08

3 Answers3

75

add this to your activity definition

android:exported="false"
lomec
  • 1,356
  • 1
  • 11
  • 10
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

furykid
  • 703
  • 7
  • 8
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.

Peterdk
  • 15,625
  • 20
  • 101
  • 140
  • 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! – Imesh Chandrasiri Jul 04 '12 at 18:45
  • 1
    When I remove intent-filter, the application force closed. When I re insert it, it works fine.. Why? – NewUser Sep 04 '12 at 06:43