Skip to content

Location not tracking #2

Description

@coldembrace

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:

  1. Changed kotlin version in build.gradle: 'kotlin': '1.3.50'
  2. Changed btnTrack.setOnClickListener { getFromLocationWithPermissionCheck() } to btnTrack.setOnClickListener { getFromLocation() } in MainActivity (misstype in the function's name).
  3. 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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions