问题
I have an Activity X which is only accessible after you've entered a valid credential.
How can I prevent other apps from calling startActivity with an Intent pointing to X ?
e.g.
Intent intent = new Intent( this, ActivityX.class );
startActivity( intent );
Basically I don't want Activity X to be exported to any apps except my app.
回答1:
Check out the "Declaring and Enforcing permissions" section of the Security and Permissions Android SDK documentation.
来源:https://stackoverflow.com/questions/1571615/preventing-apps-from-invoking-my-activity