How to remove a particular activity from android stack?
Most common problem face, when developing the application which has the circular flow or you can say loop flow. For E.g. Suppose if you move from A ➜ B ➜ C ➜ D ➜ E then from E ➜ C in C you click on some button and move to C ➜ D. Now when you move from E ➜ C ➜ D it will create another copy of C activity and D activity to stack.So whenever you press back button your flow look like this D [New Activity] ➜ C [New Activity ] ➜ E ➜ D [Old Activity] .So to overcome this issue here is the simple solution. First of all lets create HashMap static object with name of " screenStack ". public static HashMap<String, Activity> screenStack; Now, create method addActivities() which add the activity in screenStack. // Add activity public static void addActivity(String activityName, Activity activity) { if (Config.scr...