I have an activity which is called by few other activities. For example: I have Activity1,Activity2,Activity3. Activity1 calls Activity2 and pass parameter. Activity3 also c
I'm Using This line
if (((((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1).get(0).baseActivity)).compareTo(new ComponentName(getPackageName() , AnyActivityWantToCheck.class.getName())) == 0){ // do somthing ..... }
i hope it work with you