Skip to content Skip to sidebar Skip to footer

How To Enforce The Custom Permission On An Activity In Android?

I have created a custom permission in android as:

Solution 1:

Use android:permission attribute into activity tag.

Like below

<activityandroid:permission="com.master.me.CUSTOM_PERMISSION_TEST"android:name=".YourActivity"android:label="@string/activity_label" />

And you need to add uses-permission to your custom permission, when your other application needs to launch this activity.

<uses-permissionandroid:name="com.master.me.CUSTOM_PERMISSION_TEST"/>

An In-Depth Introduction to the Android Permission Model is a very good article to understand permission in Android. And How to use custom permissions in Android? is also a very good SO thread.

Post a Comment for "How To Enforce The Custom Permission On An Activity In Android?"