Given the use case where the user has to perform an online transaction, eg online payment, using the app.
This should be done without blocking the UI, so i was going to use AsyncTask. The problem is with the following scenario: - the user rotates the phone or gets an incoming call in the middle of the transacion, thus causing the activity to be destryed.
If I understood correctly the asynctask now has a reference to a stale object. So after the transaction is done, there is no way to inform the user about the result. Is it?
Should be use a service instead?
What is a Service?
Should you use a service or a thread?
What causing the activity to be destryed when user rotates the phone?
Possible workaround to solve AsyncTask interruption due to Activity recreation: