I've been learning alot from this wonderful website, and I'd like to ask my first question on Android; For security reasons, would there be any way I could prevent any other apps from starting my own app? Thank you very much
Asked
Active
Viewed 112 times
1 Answers
0
When an app is calling another app, it usually uses startActivity or startActivityForResult.
If the call is made with startActivity, there is nothing than can get you the sender information (http://stackoverflow.com/questions/4789155/how-to-find-intent-source-in-android) :
private String mAction;
private Uri mData;
private String mType;
private String mPackage;
private ComponentName mComponent;
private int mFlags;
private HashSet<String> mCategories;
private Bundle mExtras;
If it uses, startActivityForResult, it creates an intent that you can get through getIntent() and eventually retrieves the original intent and do a kill if you're in this case.
So in short, you're not 100% sure it will work.

Gomoku7
- 1,362
- 13
- 31
-
Many thanks for your answer. I'm new to the website, How do I give you a credit for your answer? – Andev May 23 '12 at 11:17
-
You're welcome. There is a small button "accept as an anwser". You can also upvote answers. – Gomoku7 May 23 '12 at 16:14