I'm working on a 3rd party library that will get integrated into other people's APK's. I have added a new Activity in my library; however, I would like to see if the people integrating my library has declared my new Activity in their AndroidManifest.xml (maybe they forgot by accident).
I'm under the impression that AndroidManifest can not be read nor edited during RunTime.
Also note that I'm not guaranteed to be given an instance of Activity in my code. only the global Application Context.
What i DO NOT what to do is to try to startActivity and catch a ActivityNotFoundException. i.e. something like:
Context ctx = someView.getContext(); // <--- this is a global application context, not necessarily an instance of Activity
Intent intent = new Intent(ctx, UnsureActivity.class);
try {
ctx.startActivity(intent);
} catch (ActivityNotFoundException anfe) {
System.out.println("UnsureActivity wasn't declared in manifest");
}
because if the activity was declared in Manifest, then the above code would actually run (which snatches the developer's activity).
note: I need to know at Run-Time because I have to alert a server ahead of time before actually trying to run the activity.
Anyone have ideas?