Go back to the First/Main activity without reloading it
This is how to do it:
Intent i = new Intent(this, MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);
metntion it in your AndroidManifest.xml file
<activity android:name=".MyActivity"
android:configChanges="keyboardHidden|orientation">
do nothing inside the method onResume()
and onstart()
when coming back to this activity
and try intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
instead of addFlags()
method