Created binder for service.
This commit is contained in:
parent
fa32356a9c
commit
3b40094457
|
|
@ -23,7 +23,7 @@ public class LocationLoggingService extends Service implements LocationListener
|
|||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
return new LocationLoggingServiceBinder(this);
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.proculite.logmylocation;
|
||||
|
||||
import android.os.Binder;
|
||||
|
||||
public class LocationLoggingServiceBinder extends Binder {
|
||||
public final LocationLoggingService service;
|
||||
|
||||
public LocationLoggingServiceBinder(LocationLoggingService service){
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public LocationLoggingService getService(){
|
||||
return this.service;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue