Some times we may need to close previous all activities before calling an intent, so that the previous activity do not loads on clicking the Android back button.Here is a simple sniffet for it..
Intent intent = new Intent(getApplicationContext(), MainClass.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent);
Comments
Post a Comment