Skip to content

Instantly share code, notes, and snippets.

@nalitzis
Last active December 12, 2015 08:09
private void bindService(){
Intent intent = new Intent("com.example.testbinder.ClientService");
this.bindService(intent, myConnection, BIND_AUTO_CREATE);
}
private ServiceConnection myConnection = new ServiceConnection(){
@Override
public void onServiceConnected(ComponentName className, IBinder binder) {
messenger = new Messenger(binder);
isBound = true;
}
@Override
public void onServiceDisconnected(ComponentName className) {
messenger = null;
isBound = false;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment