I create one application and never use finish() for each activity. If my user clicks on the logout button it goes to the previous page.
How can I close my previous
To clear whole stack which is tracking your activities in android you can use following code
Intent intent = new Intent(this, MyHomeActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); finish(); startActivity(intent);