What is the relationship between the life cycle of an AsyncTask and an Activity? What problems can this result in? How can these problems be avoided?
an async task works within the activity so the lifecycle does not come together. as async task works continuously for a period of time until it completes the process it is doing. so if the app does any activity which destroys the instance of the activity the app may make an exception because the async task will return an instance to the older activity instance which is destroyed.
to avoid this exception user must use other option such as service or sync adapter for a long-running service.