Skip to content Skip to sidebar Skip to footer

Android: Is It A Good Practice To Define Custom Permission For An Activity Which Has Intent Filters?

I have an app in which an activity is supposed to be started by deep links in messages. Should I define custom permission for that activity so that malicious service/apps cannot ca

Solution 1:

Should I define custom permission for that activity so that malicious service/apps cannot call it?

Probably not. If the activity will only ever be started by your code, get rid of the <intent-filter>. If, on the other hand, the activity is supposed to be started by something else, that "something else" will not request your custom permission, and so it is guaranteed to fail to start the activity.

Post a Comment for "Android: Is It A Good Practice To Define Custom Permission For An Activity Which Has Intent Filters?"