android - How to update Listview from background service -
i have background service downloading image server.i want update ui or listview when download finished.want change text on button "downloaded". please me out in advance
either can through broadcast background service received main thread activity. onrecieve()
method can update listview
updating model , calling notifydatasetchanged()
of adapter.
example of broadcast reciever http://www.tutorialspoint.com/android/android_broadcast_receivers.htm
or can pass handler of main thread service usnig intent , can update main thread or listview
posting message on main thread using handler.
example of handler
https://developer.android.com/training/multiple-threads/communicate-ui.html
Comments
Post a Comment