ActivityManager: java.lang.SecurityException: Permission Denial: starting IntentThe cause and solution are very simple:
- This error is most likely caused by a duplicate Activity class entry in the manifest file.
The solution should be clear by now:
<activity android:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- lots of stuff --> <activity android:name="MainActivity"></activity>
- Remove the duplicate
tag from the AndroidManifest.xml file
- Build the application again
- Reload the application
This is quite the opposite of forgetting to add an Activity class to the manifest file. And, yet, it leads to a failure just the same. Proper maintenance of the manifest file is important. It's not a file to mess around with.
Happy Android Coding!