On Nov 8, 1:29 pm, Christoph <[EMAIL PROTECTED]> wrote:
> After onResume(), when the Activity is already displayed,
> onServiceConnection() gets eventually called. But I cannot get any
> information from the service before then, as described above in
> onResume().
Right. No point in even trying to run code in onResum that has a
dependency on the service
.I suggest reorganizing the code so that your activity is the listener
rather than the inline
class you posted.
public void onResume() {
boolean result = bindService(pigeon_service, this, 0); // 0 =
do not auto-start
}
public void onPause() {
unbindService(this);
}
public void onServiceConnected(ComponentName className, IBinder
service) {
service = SomethingService.Stub.asInterface(service);
run_code_that_depends_on_the_service();
}
Don
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---