LocationServices.getFusedLocationProviderClient(Activity()) - Attempt to invoke virtual method 'getApplicationContext()' on a null object reference
I'm building an android app which using a map fragment.
Lately I redesigned my app and moved the map view to a fragment.
everything worked before, I'm asking for permissions and manifest has the parent activity of the current fragment.
While I'm trying to get fused location provider as following:
override fun onMapReady(googleMap: GoogleMap) {
mMap = googleMap
mFusedLocationClient =
LocationServices.getFusedLocationProviderClient(Activity())
}
I'm getting:...