android - Implementing callback from Service to Activity -


this question has answer here:

i have been playing service, cannot them run need. need call service functions activity, , use this

public class localbinder extends binder {     localservice getservice() {         return localservice.this;     } } 

but how callback activity once long network operation done?

i want show spinner on action bar while service something, , when finishes hide it. need persist on different activities have same action bar.

also, serviceconnection asynchronous callback, how bind service, wait callback and then change case case function of service call?

well , call service's function synchrounous , implementation of function on service can asynchrounous (for example , using asynctask ) , when result finished , can either send intent , or call listener stored call .


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -