简体   繁体   中英

sync and async request java android

I'm using geocoder which makes a sync request. I'm also making an async request to another service on another thread. I need both results inorder to procede to the next step in my android app. What is the proper way to make sure both results are returned before moving on?

You can put the sync request in the doInBackground() method of your AsyncTask. And handle the result in postExecute().

Just wondering: your sync request won't freeze the UI thread?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM