i use asynctask to do the GET request to server, and What i want to do is when the internet connection down ( no internet connection ) i want my AsynTask sleep abit then start send request again in the same asynctask , How can i do that
THx
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A logical thing to do would be listen to connectivity change broadcast and cancel the task when no connection available and restart it when the connection gets available again. You could check this Q to get the BroadcastReceiver ready.