I am developing an android application and I am using a service that tracks location via GPS every 10 minutes. But when I put the location listener in a timer task, it throws an exception:
Cannot put code inside thread that has not called
looper.prepare()
.
Does anyone have any insight on this problem?
This method is easy and can update UI thread: