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
@Override
public void onClick(View v) {
if (v == btnAtGlanceBack) {
Intent backIntent = new Intent(this, Dashboard.class);
startActivity(backIntent);
} else if (v == btnAtGlanceLogOut) {
Intent logoutIntent = new Intent(this, GlobalScholarLogin.class);
logoutIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(logoutIntent);
}
}