I want to wait one minute before downloading from server using httpconnection. What can I use in order for the program to stop for one minute?
I want to wait one minute before downloading from server using httpconnection. What can
Share
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.
Do not call
sleepto pause a thread. You would likely be pausing the event thread, which could cause your app (and possibly the phone itself) to appear to lock up for a minute.Best thing to do is set a timer using java.util.Timer and have it wait for 60 seconds before doing the HTTP connection. You’ll need to do the latter in a separate thread anyhow, so it’s not a big deal to have that thread triggered off a timer.