I have an Activity instance in a helper class, and I'm trying to get attributes from its entry in a file AndroidManifest.xml.
I can get a list of all instances ActivityInfo, but how do I target a specific application?
The activity instance is not in the same package as the helper class and is not defined in the same manifest (the helper class is a library included in the activity application project).
What I still have:
Activity activity =
String applicationPackage = activity.getApplicationInfo().packageName;
PackageInfo info = activity.getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
for (ActivityInfo activityInfo : info.activities) {
if () {
return activityInfo.someProperty;
}
}
source
share