I have implemented code where I need location offline.
I have implemented same code in Java I am getting a location instantly when I enable GPS location (it envoke onLocationUpdated instantly) but in kotlin It not invoking as It is working in Java.
Declare Permission in Manifest. Also allow runtime permission.
Thanks for the great library
I have implemented code where I need location offline.
I have implemented same code in Java I am getting a location instantly when I enable GPS location (it envoke onLocationUpdated instantly) but in kotlin It not invoking as It is working in Java.
Declare Permission in Manifest. Also allow runtime permission.
Using SmarLocation Library. compile 'io.nlopez.smartlocation:library:3.3.3'
OnButton Click check location enables or not and as per conditions start Location
btn.setOnClickListener(View.OnClickListener { Log.e(TAG, "get Location click ")
Implemented OnLocationUpdatedLister & print latitutde & longitude in Log.
override fun onLocationUpdated(location: Location?) {
Is there I am missing something in this code?
Same way I have implemented in Java it works perfectly. But in kotlin it didn't provide callback for onUpdateLocation(location: Location) method.