Skip to content

Cannot get latest location from fun getCurrentLocation(context: Context,onResult: (LocusResult) -> Unit) #85

@mary-ng5519

Description

@mary-ng5519

the API doesnt support for threadings from androidx.work, we tried async{}, runBlocking{} but it doest help, the API runs async in the underlying thread
Cannot get latest location from fun getCurrentLocation(context: Context,onResult: (LocusResult) -> Unit)

class MyWorker(mContext: Context, workerParameters: WorkerParameters) :
    Worker(mContext, workerParameters) {
  override fun doWork(): Result {
Locus.getCurrentLocation(applicationContext) { result ->
                    result.location!!.let {
//none of values retrived
}
}
  }
}

Please help support API return in future/promises

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