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.
<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>
The solution should be clear by now:- 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!
7 comments:
how can I open the window where I can edit the coding?
Hi Leoriver42,
To be honest, I'm not at all sure what you're asking. Can you elaborate further?
Thanks!
hi!
In the post there is a kind of example box with some coding right? Where I am supposed to work in (edit it?)
How do I open that window and how do i
remove duplicate tag and build application again? I don't see any duplicate in there :-/
sorry for the bother, I just got my android and unfortunately I suck at these things
Thanx :P
The example box shows a piece of the AndroidManifest.xml file with a duplicate activity setting. You'd edit this in whatever editor you used to create it for your application (most likely Eclipse).
Just to clarify... this is a tip for developers, not users. :)
ah ok... i'm a user xD
Thanks though :P
Hi again,
I am almost done with Sam's, I'm thinking of getting Wireless next...
A few quick questions:
Is Wireless good enough to learn some simple animation and "click change animation"? (Basically, I want a small 24px x 24px image to "drop down" from the top till around 25% of the screen, if the user clicks a button the image should be switched to another animation file so that the graphic can be seen to "explode")
I guess I will also need to brush up on threads and how to use them in Android.
Would you recommend Wireless for the above or some ohter book?
Thanks!
Hi again,
I am almost done with Sam's, I'm thinking of getting Wireless next...
A few quick questions:
Is Wireless good enough to learn some simple animation and "click change animation"? (Basically, I want a small 24px x 24px image to "drop down" from the top till around 25% of the screen, if the user clicks a button the image should be switched to another animation file so that the graphic can be seen to "explode")
I guess I will also need to brush up on threads and how to use them in Android.
Would you recommend Wireless for the above or some ohter book?
Thanks!
Post a Comment