I am using google play services to get my last location. the project is working fine without force closing, however, it never gets any location. i assume it doesn\'t require
GetLastLocation is called by the FusedLocationApi and stores the last location based on the last client that had used it. If your app is the first client to use it, it probably will not have gotten the last location as quickly as you call your "OnConnected()" function.
Here you have some potential options:
1. Create A Checking Thread
You could implement a thread that checks for the last known location every X amount of seconds. Then, regardless of whether or not your app was the first to launch, you will eventually receive the last location.
2. Implement Location Listening
You could also implement Location Listening in your activity and update your location every time the OnLocationChanged event is fired.