I have develop one application in which 3 activity.
in first activity there are so much images.
in second, images + sound + background sound
in third activity background sound + replay button
Problem : now when i am play app in device first time work fine but when i click it replay at second activity give error. i think it is memory problem
so i have try
intent2.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
but still not get solve.
I need code which clear previous data (images and sound) when i am calling second.
In your activity, override
onPause(). This is called when a new activity is loaded. If the user returns,onResume()is called. You can read more about the Activity Lifecycle to see when these methods are called.