简体   繁体   中英

Fetch data from server and refresh UI when data is fetched?

I want to fetch data from server and refresh UI when data is fetched in Android.

What should I use? an AsyncTask or a Service or something else?

You can use the Async task and a method which sets the contentview (layout) of your screen. After the data has been fetched from the server, you can again refresh the screen by calling the method in postexecute() of Asynctask.

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