Last active
December 12, 2015 08:09
-
-
Save nalitzis/4742036 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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