Hello,
I have the following problem:
I have an Activity which starts an second thread using
bindService(new Intent(this, MyService.class), mConnection,
                                Context.BIND_AUTO_CREATE);
where MyService is the Service class i want to start.
mConnection is defined as following:
private ServiceConnection mConnection = new ServiceConnection() {
                public void onServiceConnected(ComponentName className, IBinder
binder) {
                        s = ((MyService.MyBinder) binder).getService();
                        Toast.makeText(getApplicationContext(), "Connected",
                                        Toast.LENGTH_SHORT).show();
                }

                public void onServiceDisconnected(ComponentName className) {
                        s = null;
                }
        };
Now i set an variable of this thread and leave the Activity using the
back button of my mobile phone.
in the onPause Routine is an call of the following function:
void doUnbindService(){
                unbindService(mConnection);
        }
now when i return to my app the service is running, but my application
creates an new one, and i cant acces the old one.
I have already tried not to call doUnbindService, but this didn't
help.
Does anyone have an idea how i can get controll over the already
started Thread again ?

Thalhammer

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