I am creating an application which requires login. I created the main and the login activity.
In the main activity onCreate
method I added the following
What about ensuring the collection of native memory with such global structures?
Activities have an onPause/onDestroy()
method that's called upon destruction, but the Application class has no equivalents. What mechanism are recommended to ensure that global structures (especially those containing references to native memory) are garbage collected appropriately when the application is either killed or the task stack is put in the background?