Skip to content

Instantly share code, notes, and snippets.

@parahall
Created May 7, 2018 21:30
Show Gist options
  • Save parahall/c2a6bb4701a1e8767578c54463702a90 to your computer and use it in GitHub Desktop.
Save parahall/c2a6bb4701a1e8767578c54463702a90 to your computer and use it in GitHub Desktop.
@Override
public WorkerResult doWork() {
...
LocalBroadcastManager.getInstance(getAppContext()).registerReceiver(receiver, new IntentFilter(LocationBaseBroadcast.ACTION_NEW_LOCATION_ARRIVED));
locationTracker.start();
try {
locationWait = new CountDownLatch(1);
locationWait.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
cleanUp();
return WorkerResult.SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment