How to get the list of all activities in our application that are running on the device.
For example: pdf generation and email activities included.
I can check for activities with the code like:
ActivityManager am = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
// get the info from the currently running task
List< ActivityManager.RunningTaskInfo > taskInfo = am.getRunningTasks(1);
Log.d("topActivity", "CURRENT Activity ::"
+ taskInfo.get(0).topActivity.getClassName());
ComponentName componentInfo = taskInfo.get(0).topActivity;
componentInfo.getPackageName();
This will however give information about the running activity which is the top activity.
My idea is to whitelist the activities running so that my third party application can run it while on the device. So I basically need all of the running activities in the application.