Reputation: 1
I have an Async task in my app that will trigger some things when it is finished, but this causes some issues is the phone goes to sleep. I need a way to know, when I come back to the app, that the Async Task did it's work. I have looked around quite a bit about this but I think my problem is I don't even know where to begin. Any information is helpful.
Upvotes: 0
Views: 117
Reputation: 10338
Try dismissing the dialog fragment in your onpause method. And check if your layout is visible to your users in your AsyncTask's onPostExecute() method like this:
RelativeLayout root = (RelativeLayout)findViewById(R.id.root);
root.isShown()//check if the layout is visible to user
Upvotes: 0