Android: java.lang.SecurityException: Permission Denial: start Intent Android: java.lang.SecurityException: Permission Denial: start Intent android android

Android: java.lang.SecurityException: Permission Denial: start Intent


You have to add android:exported="true" in the manifest file in the activity you are trying to start.

From the android:exported documentation:

android:exported
Whether or not the activity can be launched by components of other applications — "true" if it can be, and "false" if not. If "false", the activity can be launched only by components of the same application or applications with the same user ID.

The default value depends on whether the activity contains intent filters. The absence of any filters means that the activity can be invoked only by specifying its exact class name. This implies that the activity is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "false". On the other hand, the presence of at least one filter implies that the activity is intended for external use, so the default value is "true".

This attribute is not the only way to limit an activity's exposure to other applications. You can also use a permission to limit the external entities that can invoke the activity (see the permission attribute).


The java.lang.SecurityException you are seeing is because you may enter two entries pointing to the same activity. Remove the second one and you should be good to go.

More Explanation

You may be declared the activity 2 times in the manifest with different properties, like :

 <activity android:name=".myclass"> </activity>

and

 <activity android:name=".myclass" android:label="@string/app_name">      <intent-filter>          <action android:name="android.intent.action.MAIN" />         <category android:name="android.intent.category.LAUNCHER" />     </intent-filter> </activity>

You should remove the unwanted one from the manifest


In your Manifest file write this before </application >

<activity android:name="com.fsck.k9.activity.MessageList">   <intent-filter>      <action android:name="android.intent.action.MAIN">      </action>   </intent-filter></activity>

and tell me if it solves your issue :)