Advertisement
Guest User

DistantService

a guest
May 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package com.example.mael.servicedistanttest;
  2.  
  3. import android.app.Service;
  4. import android.content.Intent;
  5. import android.os.Binder;
  6. import android.os.IBinder;
  7.  
  8. /**
  9. * Created by mael on 24/05/17.
  10. */
  11.  
  12. public class DistantService extends Service {
  13. private final IBinder monBinder = new distantBinder();
  14.  
  15. public class distantBinder extends Binder{
  16. DistantService getDistantService(){
  17. return DistantService.this;
  18. }
  19. }
  20.  
  21. @Override
  22. public IBinder onBind(Intent intention){
  23. return monBinder;
  24. }
  25.  
  26. public int getValeur(){
  27. return 123;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement