Posted on .
When we use to navigate from one Activity to another than the previous values resides in our device stack so Here is  some Tips to clear  or kill it .. METHOD 1 - For API level 11 or greater, use FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_NEW_TASK flag on Intent to clear or kill all the activity stack. Intent intent = new Intent(OldActivity.this, NewActivity.class); // set the new task and clear flags intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK) startActivity(intent);   METHOD 2 - Simply use  android:noHistory="true" in AndroidManifest.xml file .     Read More
Posted on .
This is very simple and asked everywhere like interviews and during our LIVE projects . Lets explore . METHOD - 1 You need to @ override onSaveInstanceState(Bundle savedInstanceState) and note down your application values which you want to save eg: @Override public void onSaveInstanceState(Bundle savedInstanceState) {super.onSaveInstanceState(savedInstanceState);// Save UI state changes to the savedInstanceState.// This bundle will be passed to onCreate if the process is// killed and restarted. savedInstanceState.putBoolean("AndroidBoolean",true); savedInstanceState.putDouble("AndroidDouble",1.9); savedInstanceState.putInt("AndroidInt",1); savedInstanceState.putString("AndroidString","Welcome back to Android Arena");// etc.} Bundle stores values in... Read More