Code example for View

Methods: setEnabled

0
  @Override 
  public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
    serviceIntent=buildServiceIntent();
 
    command.setEnabled(serviceIntent != null);
    binding.setEnabled(serviceIntent != null);
  } 
 
  @Override 
  public void onServiceConnected(ComponentName arg0, IBinder arg1) {
    SomethingUseful binder=SomethingUseful.Stub.asInterface(arg1);
 
    try { 
      binder.hi();
    } 
    catch (RemoteException e) {
      Log.e(getClass().getSimpleName(),
            "Exception communicating with remote service", e);
    } 
 
    unbindService(this);