Why isn't onServiceConnected called?
<p>I am a beginner who made a simple program to show how services work.</p>

<pre><code>.....
toStartService = new Intent(this, SimpleService.class);
    sc = new ServiceConnection() {            
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            Toast.makeText(MoreService.this, "SC: Binded", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onServiceDisconnected(ComponentName name) {
            Toast.makeText(MoreService.this, "SC: Unbinded", Toast.LENGTH_SHORT).show();
        }    
    };


    startService.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(MoreService.this, "Starting Service", Toast.LENGTH_SHORT).show();
            startService(toStartService);        
        }
    });

    stopService.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            stopService(toStartService);
        }
    });

    bindService.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if((isBound = bindService(toStartService, sc, BIND_AUTO_CREATE))) {

            }
        }
    });

    unbindService.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if(isBound) {
                unbindService(sc);
                isBound = false;
            }
        }
    });

}
</code></pre>

<p>Why didn't passing the sc variable (on bindService()) call the sc.onServiceConnected() method?
Whats wrong with the code?</p>

<p>I met this following condition:</p>

<ul>
<li><p>When i press [startService] the
service started well, then
[stopService] the service stoped well.</p></li>
<li><p>When i press [startService] then the [bindService] does nothing, neither the [unbindService].</p></li>
<li>When i press [bindService], its created the service, the [stopService] didnt work.  I press [unbindService] the service is calling the onDestroy() method.</li>
</ul>

<p>Why does the service that is created by bindService is destroyed when unbinded? I try to start the service with startService, but it cannot bind.</p>

<p>Arrgh help mee, sorry if i was wrong.</p>
