I have got a small problem in an Android app I am working on :
There are 3 activities namely A , B , C and the invocation is in the following order : A -> B -> C.
In activity B:
public static boolean mDestroyActivity = false; @Override protected void onResume() { super.onResume(); /** * exit when back from Activity C-> A (skip activity B) */ Log.i("FINISH", "= " + mDestroyActivity); if (mDestroyActivity) { mDestroyActivity = false; finish(); } }
In activity C:
B.mDestroyActivity = true;