Asynctask lifecycle This android application describes the lifecycle of an async task in different situations. What happens to a current running asyncTask if the activity gets destroyed, paused or the application gets killed. Also it discribes the use of Weak references and Strong references in android and the solves the problem of Memory Leak. Uses weak reference of the main activity so that memory leaks do not occurs even when the asyncTask is running but the host activity has been destroyed. Also uses the task.cancel() method of async task to cancel the task
-
Notifications
You must be signed in to change notification settings - Fork 0
Explains the lifecycle of an AsyncTask when the activity is in OnPause state or when the activity gets destroyed or when the application gets destroyed. Uses Weak reference of the host Activity to avoid memory leak issues in case the user destroys the host activity but the async task is still functioning.
vyas00/AsyncTask-Lifecycle
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Explains the lifecycle of an AsyncTask when the activity is in OnPause state or when the activity gets destroyed or when the application gets destroyed. Uses Weak reference of the host Activity to avoid memory leak issues in case the user destroys the host activity but the async task is still functioning.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published