I have 3 activities: A. B ,...., C From A: Click open B. From B: click open C
At C: i want close all activities (B,..,C) and back to A: I use this code, but it only close activity C, not close activities (B,...) :
Intent intent = new Intent(getApplicationContext(), A.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Bundle b = new Bundle();
b.putBoolean("UpdateVersion", true);
intent.putExtras(b);
startActivity(intent);
Why can't close all activities?