Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

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?

like image 605
Harinder Avatar asked Apr 30 '26 19:04

Harinder


1 Answers

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.

like image 140
Jaydeep Khamar Avatar answered May 03 '26 09:05

Jaydeep Khamar