Android - java.lang.SecurityException: Permission Denial: starting Intent
This is only for android studio
So I ran into this problem recently. The issue was in the build/run configuration. Apparently android studio had chosen an activity in my project as the launch activity thus disregarding my choice in the manifest file.
Click on the module name just to the left of the run button and click on "Edit configurations..." Now make sure "Launch default Activity" is selected.
The funny thing when I got this error was that I could still launch the app with from the device and it starts with the preferred Activity. But launching from the IDE seemed impossible.
Select your proper configuration for launching Application.
In my case i found mistake as below image:
I had just changed like:
May it will help to someone, Thanks :)
You need to set android:exported="true"
in your AndroidManifest.xml
file where you declare this Activity
:
<activity
android:name="com.example.lib.MainActivity"
android:label="LibMain"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" >
</action>
</intent-filter>
</activity>