开发者

Problem delaying doingbackground in asyncTask !

开发者 https://www.devze.com 2023-03-23 16:00 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号