Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class LocationWork extends Worker {
...
public WorkerResult doWork() {
Log.d(TAG, "doWork: Started to work");
handlerThread = new HandlerThread("MyHandlerThread");
handlerThread.start();
looper = handlerThread.getLooper();
locationTracker = new LocationTracker(getApplicationContext(), looper);
locationTracker.start();
try {
locationWait = new CountDownLatch(1);
locationWait.await();
Log.d(TAG, "doWork: Countdown released");
} catch (InterruptedException e) {
Log.d(TAG, "doWork: CountdownLatch interrupted");
e.printStackTrace();
}
cleanUp();
return WorkerResult.SUCCESS;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.