GooglePlayServicesUtil Fehler-dialog-button tut nichts

Ich bin das hinzufügen einer MapFragment auf meine app und habe den folgenden code, angepasst von einem Karten-tutorial:

private boolean servicesConnected() {
    //Check that Google Play services is available
    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

    //If Google Play services is available
    if (ConnectionResult.SUCCESS == resultCode) {
        //In debug mode, log the status
        Log.d("Location Updates", "Google Play services is available.");
        //Continue
        return true;

    //Google Play services was not available for some reason
    } else {
        GooglePlayServicesUtil.getErrorDialog(resultCode, this, 7).show();
        return false;
    }
}

Teste ich auf einem factory reset Galaxy tab 10.1 mit veralteten google-play-Dienste. Also, wenn ich versuche, öffnen Sie die MapFragment ich nenne servicesConnected() zu überprüfen und, wie zu erwarten, bekomme ich ein Dialogfeld, sagen mir, ich muss die Google Play-Dienste. Am unteren Rand des Dialogfeld eine Schaltfläche "Google Play-Dienste" aber wenn ich drauf klicke, es tut sich nix. Mein LogCat wird die folgende Ausgabe erzeugt:

07-23 15:30:43.580: W/GooglePlayServicesUtil(2515): Google Play services is missing.
07-23 15:30:48.510: E/SettingsRedirect(2515): Can't redirect to app settings for Google Play services

Habe ich Folgendes onConnectionFailed Methode (im Grunde ein copy-paste aus dem Android-Developer-Website):

public void onConnectionFailed(ConnectionResult connectionResult) {
    /*
     * Google Play services can resolve some errors it detects.
     * If the error has a resolution, try sending an Intent to
     * start a Google Play services activity that can resolve
     * error.
     */
    if (connectionResult.hasResolution()) {
        try {
            //Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult(
                    this,
                    CONNECTION_FAILURE_RESOLUTION_REQUEST);
            /*
             * Thrown if Google Play services canceled the original
             * PendingIntent
             */
        } catch (IntentSender.SendIntentException e) {
            //Log the error
            e.printStackTrace();
        }
    } else {
        /*
         * If no resolution is available, display a dialog to the
         * user with the error.
         */
        GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 7).show();
    }
}

Warum das nicht funktioniert? Jede Hilfe wäre toll.

Hier's das Android dev Seite arbeite ich von zu und hier's a SO post bezogen, es so gut.

Bearbeiten

Merkte ich, dass ich nicht über ein Google-Konto eingerichtet auf dem Gerät, so dass ich eins eingerichtet, aber es machte keinen Unterschied.

InformationsquelleAutor Mike T | 2013-07-23
Schreibe einen Kommentar