Reputation: 21
As title, I have an application that only want user to launch from home screen or the history menu. Can we detect whether the app is launched by any other application?
I have tried the intent.getFlags() method but unfortunately seems the caller application can set the flag value to the desired value too.
Upvotes: 2
Views: 749
Reputation: 178
You can't detect, but what you can do is set special permissions in the manifest using <permission />
tag and set android:permission
attribute in the desired activity. That way, it will be available only for applications having you signature. Here are security tips in detail.
Upvotes: 1