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

django - How can I change user group without delete record -

java - EclipseLink JPA Object is not a known entity type -

java - Need to add SOAP security token -