Le service de liaison Android retourne false à chaque fois

boolean isBound = bindService(new Intent(SocketServiceController.this, SocketService.class), mConnection, Context.BIND_AUTO_CREATE);

Service Bind renvoie toujours false pour moi... quelqu'un Pourrait-il me dire les erreurs que j'ai prise...

Service code est comme suit

public class SocketService extends Service{

@Override
public IBinder onBind(Intent arg0) {
    //TODO Auto-generated method stub
    return myBinder;
}

private final IBinder myBinder = new LocalBinder();

public class LocalBinder extends Binder {
    public SocketService getService() {
        return SocketService.this;
    }
}

@Override
public void onCreate() {
    super.onCreate();
}

public void IsBoundable(){
    Toast.makeText(this,"Is bound", Toast.LENGTH_LONG).show();
}

public void onStart(Intent intent, int startId){
    super.onStart(intent, startId);
    Toast.makeText(this,"Service created ...", Toast.LENGTH_LONG).show();
}

@Override
public void onDestroy() {
    super.onDestroy();
}

}

Service de Contrôleur de code est comme suit:

 public class SocketServiceController extends Activity{
private SocketService mBoundService;
private Boolean mIsBound;
public SocketServiceController ssc;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ssc = this;
setContentView(R.layout.telnet);
Button startButton = (Button)findViewById(R.id.button1);
Button endButton = (Button)findViewById(R.id.button2);
Button bindButton = (Button)findViewById(R.id.button3);
startButton.setOnClickListener(startListener);
endButton.setOnClickListener(stopListener);
//bindButton.setOnClickListener(this);
TextView textView = (TextView)findViewById(R.id.textView1);
}
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
mBoundService = ((SocketService.LocalBinder)service).getService();
}
@Override
public void onServiceDisconnected(ComponentName className) {
mBoundService = null;
}
};
private void doBindService() {
boolean isBound = bindService(new Intent(SocketServiceController.this, SocketService.class), mConnection, Context.BIND_AUTO_CREATE);
mIsBound = true;
//mBoundService.IsBoundable();
}
private void doUnbindService() {
if (mIsBound) {
//Detach our existing connection.
unbindService(mConnection);
mIsBound = false;
}
}
private OnClickListener startListener = new OnClickListener() {
public void onClick(View v){
startService(new Intent(SocketServiceController.this,SocketService.class));
doBindService(); 
}               
};
private OnClickListener stopListener = new OnClickListener() {
public void onClick(View v){
stopService(new Intent(SocketServiceController.this,SocketService.class));
}               
};
@Override
protected void onDestroy() {
super.onDestroy();
doUnbindService();
}

}

source d'informationauteur Arun Abraham | 2011-03-15