Android IDE (AIDE) Support Forum

Close Activities

Please tell me how to do it !

See, suppose I have four different activities: Activity 1, Activity 2, Activity 3 and Activity 4.
I opened Activity 1 from there I clicked a button and opened Activity 2 from there I opened Activity 3 from there I opened Activity 4 and from there I wish (on a clicking event) to close all previously opened Activities except Activity 1.
Meaning when I click on that button in the Activity 4 - close Activity 3 and Activity 2 - but excluding Activity 1.

How can I implement that logic ?

Put “finish()” method in activity 2 on click event same as in activity 3

1 Like