My Application uses a service that is started by a BOOT_COMPLETE
BroadcastReceiver like this:
public void onReceive(Context context, Intent intent) {
context.startService(new Intent(context,
MyService.class));
}
}
If, in an activity in my application, I try to bind to this service
like this:
getApplicationContext().bindService(new
Intent(getApplicationContext(),
MyService.class), _serviceConnection,
Context.BIND_AUTO_CREATE);
a new Instance of the Service is created, allthough the first instance
(created by the BroadcastReceiver) is still runnning. I logged the
process IDs in the onCreate() method of the service and the first
service runs in a different process than the activity, the second
instance is created in the same process as the activity. I tried
setting a android:process argument in the service element of the
manifest (both with leading : and without), but the result stays the
same.
How do I bind to the service from a different process without creating
a new instance?
Thanks for your help!
--
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