How to kill stack activity
Please tell me any one, how to kill previous stacked activity.My requirement is like that let I move from activity A---->B----->C------>D----->E Then activity stack will be E-D-C-B-A Now I am at E if my all work is done then I move to activity B using
this code will be kill only E activity but I want to kill C D activity also. how can I do that. thanks.
One solution is to call Activity [B] with flag FLAG_ACTIVITY_CLEAR_TOP
Intent b = new Intent(this,B.class); b.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(b); this.finish();
This will kill C D E