I have a problem using AsyncTask. I want my doing background send data to server via GET (success) BUT (Problem) when there is no connection i have to resend three time before save in my sqlite>? how can i do that开发者_JAVA技巧 ?
PS : before resend we have to let our doing background sleep(HOW?) for abit.
Thx
Threading rule for AsyncTask:
Only once execution can be performed, any other attempt (to resume) will throw exception.
(see docs)
There you can't sleep()
in AsyncTask
For that purpose you can create BroadcastReciever
that will listen for connectivity changes.
精彩评论