Overcome
Overcome

Reputation: 21

Prevent Launcher/Main activity being launched by another Application

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

Answers (1)

cth
cth

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

Related Questions