Reputation: 21
I developed an application using android studio. I used Google Maps in my application. When opening Google maps first I want the last location of the user using the code block below.
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener);
Location lastlocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
But user last location return null. How can I fix that problem?
Upvotes: 0
Views: 34