My understanding is that the view of another activity cannot be returned. To flag when com.android.settings > Bluetooth is the current view, am I on the right track with the code below?
ActivityManager am = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
List< ActivityManager.RunningTaskInfo > taskInfo = am.getRunningTasks(30);
ComponentName componentInfo = null;
String componentInfo_getPackageName;
for(int i = 0;i<taskInfo.size();i++)
{
componentInfo = taskInfo.get(i).topActivity;
componentInfo_getPackageName = componentInfo.getPackageName();
if (componentInfo_getPackageName.contains("settings")){
Class<Object> clazz = null;
componentInfo.getClass().asSubclass(clazz);
}
}