What happens if you move start/bind to onStart of your activity?

Also, in my code I do it in the reverse order: bind first, then the binding
is established, finally startService when about to tell it to do something
in the background.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
21.12.2010 19:57 пользователь "Kalyan Akella" <[email protected]>
написал:
> Thank you for the reply.
>
> I'm indeed returning a valid IBinder inside the service's onBind method.
> Here it is:
>
> public class MyService extends IntentService {
> private Messenger myMessenger;
>
> // Service Constructor
> public MyService() {
> super("MyService");
> *myMessenger = new Messenger(new MyServiceHandler(this))*;
> }
>
> @Override
> public IBinder onBind(Intent intent) {
> Log.i(APP_TAG, "Inside service onBind");
> return *myMessenger.getBinder()*;
> }
>
> // other methods...
> }
>
> Moreover I ensured that my activity calls the *unbindService()* method
only
> from inside its *onDestroy()* method and no where else. This is exactly
> what's been puzzling me as to why android still decides to unbind & kill
the
> service even if the activity that spawned it is still alive in the first
> place.
>
> Am I missing something here ?? Any pointers ???
> Sincere Regards,
> Kalyan
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
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

Reply via email to