In my app, there are some activities doing graphical things with high resolution PNG's. I had OutOfMemoryError
errors and fixed it by adding android:largeHeap="true"
to my manifest file.
Lenovo Vibe P1 (3GB RAM Total)
In memory monitor, second activiy increase 100+ MB of RAM and doesn't decrease altought called finish()
function for it. Here is the code for starting third activity:
public void start_game(View v){
header.setText("Loading...");
Intent i = new Intent(this,game.class);
i.putExtra("episode",Integer.parseInt(v.getTag().toString()));
i.putExtra("online",false);
startActivity(i);
finish();
}
How can I completely remove activity from both UI and RAM?