0

As it's mentioned above I have used the following example:The Beginner’s Guide to Location in Android in my code I putted a tag to print an error message whenever the connection failed as it's mentioned below :

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.i(TAG, "Location services Failed to connect. Please reconnect.");

}

when ever my application is connecting to the google play services this method is invoked. while I want onConnected method to be invoked

 @Override
public void onConnected(Bundle bundle) {
    Log.i(TAG, "Location services connected.");
    currentLocation = LocationServices.FusedLocationApi.getLastLocation(
            mGoogleApiClient);
    Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
    if(location== null)
    {

    }
    else
    {
        handleNewLocation(location);
        if (currentLocation != null) {
            display.setText("Latitude: "+ String.valueOf(currentLocation.getLatitude())+"Longitude: "+
                    String.valueOf(currentLocation.getLongitude()));
        }
    }

}

also in addition I want to add something more, google play services are already installed in my Genymotion VM but I cannot get inside the play store, so any one can help me please to know from where the problem come from?

  • Possible duplicate of [How to install Google Play Services in a Genymotion VM (with no drag and drop support)?](http://stackoverflow.com/questions/20121883/how-to-install-google-play-services-in-a-genymotion-vm-with-no-drag-and-drop-su) – Rami Jemli Nov 27 '15 at 16:15

1 Answers1

0

wirte Tag word in "" and then try

Log.i("TAG", "Location services Failed to connect. Please reconnect.");

if you are using android studio then select the error in the log level and serach your TAG in it.

enter image description here