I am developing an android app. I need to call my MainActivity without reloading it as it has huge amount of data fetch from internet.
Suppose, I am on third activity now and I want to go back to MainActivity.
If I use:
Intent i = new Intent(Third.this,Main.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
it will load MainActivity but I don’t want to reload it. like from Second Activity I call finish() and it does exactly want i need.
metntion it in your AndroidManifest.xml file
do nothing inside the method
onResume()andonstart()when coming back to this activityand try
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);instead ofaddFlags()method