In part of my Activity’s code, I am calling Activity.finish() to close my activity, and the application returns to the main OS “desktop” window.
However, if I click on my application icon again, onCreate does not seem to be called and my view remains the same as when finish was called.
Perhaps, I’m not understanding the lifecycle correctly, but I thought that destroy completely destroyed the activity, and the next time it was invoked it would call onCreate.
Where am I misunderstanding this?
Thanks
Yes, it is called. Just
Log.dand you’ll see.It may remain the same because the XML content and all views instantiated are again created. However, if you modify stuff and layouts in code you’d see that it is restored to the defaults as in
setContentView(int layout).As I said, it calls.