Abdullah
Abdullah

Reputation: 21

Android Application Google Map GetLastLocation

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

Answers (0)

Related Questions