Skip to content

Instantly share code, notes, and snippets.

@nishantt12
Last active September 6, 2017 05:56
Show Gist options
  • Save nishantt12/c40a2745c7f9de26180f689b69f2ece4 to your computer and use it in GitHub Desktop.
Save nishantt12/c40a2745c7f9de26180f689b69f2ece4 to your computer and use it in GitHub Desktop.
Receiver
//Receiver for getting location.
public class PathSenseReceiver extends PathsenseInVehicleLocationUpdateReceiver {
@Override
protected void onInVehicleLocationUpdate(Context context, PathsenseInVehicleLocation pathsenseInVehicleLocation) {
L.e("onInVehicleLocationUpdate");
EventBus.getDefault().postSticky(pathsenseInVehicleLocation);
}
}
//how I am starting the location update in my main activity.
PathsenseLocationProviderApi.getInstance(this).requestInVehicleLocationUpdates(1, PathSenseReceiver.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment