Hello. Thanks for your work.
Just built your project and seems like its not working anymore on the newer versions of Android (8.1 real device, 9.0 emulator). What I've done:
- Changed kotlin version in build.gradle:
'kotlin': '1.3.50'
- Changed
btnTrack.setOnClickListener { getFromLocationWithPermissionCheck() } to btnTrack.setOnClickListener { getFromLocation() } in MainActivity (misstype in the function's name).
- Changed track time interval to 10 seconds in MainViewModel:
val locationWorker = PeriodicWorkRequestBuilder<TrackLocationWorker>(10, TimeUnit.SECONDS).addTag(LOCATION_WORK_TAG).build() so I could test it properly.
But tracking is not working neither when app is running nor when it's closed (it works only once just after the click on a corresponding button). The status of manager is always "ENQUENUED", and there's only 1 message in the Logcat:
I/WorkerWrapper: Worker result SUCCESS for Work [ id=c9848574-6e01-4d83-917b-5f7590cc8f25, tags={ prithvi.io.workmanager.utility.workmanager.TrackLocationWorker, LOCATION_WORK_TAG } ]
Appreciate any suggestions!
Hello. Thanks for your work.
Just built your project and seems like its not working anymore on the newer versions of Android (8.1 real device, 9.0 emulator). What I've done:
'kotlin': '1.3.50'btnTrack.setOnClickListener { getFromLocationWithPermissionCheck() }tobtnTrack.setOnClickListener { getFromLocation() }in MainActivity (misstype in the function's name).val locationWorker = PeriodicWorkRequestBuilder<TrackLocationWorker>(10, TimeUnit.SECONDS).addTag(LOCATION_WORK_TAG).build()so I could test it properly.But tracking is not working neither when app is running nor when it's closed (it works only once just after the click on a corresponding button). The status of manager is always "ENQUENUED", and there's only 1 message in the Logcat:
I/WorkerWrapper: Worker result SUCCESS for Work [ id=c9848574-6e01-4d83-917b-5f7590cc8f25, tags={ prithvi.io.workmanager.utility.workmanager.TrackLocationWorker, LOCATION_WORK_TAG } ]Appreciate any suggestions!