I m using below code to start another activity in my application –
Intent itab = new Intent(getApplicationContext(), TabhostScreen.class);
itab.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(itab);
how can i manage memory in this context because Activity resume each time when we call Intent.FLAG_ACTIVITY_REORDER_TO_FRONT.
so how would we manage memory?????
We use Intent.FLAG_ACTIVITY_REORDER_TO_FRONT flag so that multiple instances of the same activity is not created and activity is brought to the front in same state without popping out other activities from the history stack. Memory management is not the concern here so far as android documents suggests.
When you are rotating the device then your activity is recreated and using different layout is perfectly fine in fact it is a good practice in android. Hence memory requirement will increase. You can stop this behavior by fixing the screen orientation in the manifest file.