Using "Do not keep activities" - android developer tool

As an android developer, you have to handle all problems of your applications because when they make crashes or errors, users will be vexatious. And one of them is "Activity killed", cause by Android OS. When your app has high priority, using a lot of resources and the OS had to reclaim memory. So, if you don't handle this problem, when user open the activity again, it will be created again and cause some errors.

How to kill activity immediately?
Android OS provide an useful tool for developers, it 's "Do not keep activities" option in developer tools.

How to open it?
- Open Settings » Developer options.
- Tick to enable the option "Do not keep activities".

How to test the app in this mode?
- Switch activity and back again.
or Click Home button and open your app again.
or Open other apps and back again
- Debug and detect errors. See the Activity life cycle here:
     developer.android.com/guide/components/activities.html


References:
developer.android.com/tools/debugging/debugging-devtools.html

Leave a Reply

Powered by Blogger.