I'm creating an app that reads every Service that has an IntentFilter that matches a custom action by using this:
Intent intent = new Intent(ACTION);
List<ResolveInfo> infos = getActivity().getPackageManager()
.queryIntentServices(intent, 0);
I have no problem retrieving the Services, but when I try to bind them to the current Activity, my IBinder implementation is not passed to onServiceConnected(ComponentName, IBinder)
. Instead, a BinderProxy
is being passed.
How can I get my LocalBinder
from that BinderProxy
?
EDIT:
Here's my implementation:
public abstract class LocalService extends Service {
private LocalBinder mBinder = new LocalBinder();
public class LocalBinder extends Binder {
public LocalService getServiceInstance() {
return LocalService.this;
}
}
@Override
public final IBinder onBind(Intent intent) {
return mBinder;
}
public abstract List<Category> getInitialCategories();
public abstract void onObjectSelected(Item object,
LocalCallback callback);
}
What I want to do is to be able to call the last 2 methods from other people's implementations of my LocalService.