How to read attributes from the Android manifest?

Let's say my AndroidManifest.xml contains the following lines:

Where I used a general attribute android:tag as an additional internal information.

Now, in my activity code I do this:

private Map permissionMap = new HashMap<>();

// ...



PackageInfo info = getPackageManager().getPackageInfo(context.getPackageName(),


if (info.requestedPermissions != null)


for (String permission : info.requestedPermissions)


permissionMap.put(permission, isPermissionOptional(permission)? 1 : 0);




catch (Exception ignore) { }

But I don't have an implementation of isPermissionOptional() method yet.

How can I access the android:tag attribute of the in the manifest?

Is there some way to read the manifest XML code so I can do...

Read More »

By: StackOverFlow - Tuesday, 13 March

Related Posts