-5

I'm starting the activity "B" from the activity "A". When I'm closing the activity B using the back button or method finish(), the activity A is recreating. How can i deny activity to be destroyed?

Ingvar
  • 1

1 Answers1

0

Activities in android are stored in a Stack called activity-stack, when you go to next Activity it's added to the stack, when you go back you pop last element from stack and nothing points at it any more, so not destroying is just waste of space!

Even if you override the back button to launch previous activity with noHistory or clearTop flag, current activity would be destroyed.

I suggest that you read more on activity lifecycle

Ahmad Dwaik 'Warlock'
  • 5,953
  • 5
  • 34
  • 56