Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public class MainActivity extends AppCompatActivity {
  2.  
  3. IMyAidl iMyAidl;
  4.  
  5. @Override
  6. protected void onCreate(Bundle savedInstanceState) {
  7. super.onCreate(savedInstanceState);
  8. setContentView(R.layout.activity_main);
  9. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  10. setSupportActionBar(toolbar);
  11.  
  12. Intent intent = new Intent("br.com.packapps.aidlserver.CALL");
  13. intent.setPackage("br.com.packapps.aidlserver");
  14. bindService(intent, serviceConnection, BIND_AUTO_CREATE);
  15.  
  16. }
  17.  
  18. private ServiceConnection serviceConnection = new ServiceConnection() {
  19. @Override
  20. public void onServiceConnected(ComponentName name, IBinder service) {
  21. iMyAidl = IMyAidl.Stub.asInterface(service);
  22. }
  23.  
  24. @Override
  25. public void onServiceDisconnected(ComponentName name) {
  26.  
  27. }
  28. };
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement