Search in sources :

Example 6 with GoogleApiAvailability

use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.

the class AbstractMapActivity method readyToGo.

protected boolean readyToGo() {
    GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
    int status = checker.isGooglePlayServicesAvailable(this);
    if (status == ConnectionResult.SUCCESS) {
        if (getVersionFromPackageManager(this) >= 2) {
            return (true);
        } else {
            Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
            finish();
        }
    } else if (checker.isUserResolvableError(status)) {
        ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
    } else {
        Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
        finish();
    }
    return (false);
}
Also used : GoogleApiAvailability(com.google.android.gms.common.GoogleApiAvailability)

Example 7 with GoogleApiAvailability

use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.

the class AbstractMapActivity method readyToGo.

protected boolean readyToGo() {
    GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
    int status = checker.isGooglePlayServicesAvailable(this);
    if (status == ConnectionResult.SUCCESS) {
        if (getVersionFromPackageManager(this) >= 2) {
            return (true);
        } else {
            Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
            finish();
        }
    } else if (checker.isUserResolvableError(status)) {
        ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
    } else {
        Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
        finish();
    }
    return (false);
}
Also used : GoogleApiAvailability(com.google.android.gms.common.GoogleApiAvailability)

Example 8 with GoogleApiAvailability

use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.

the class AbstractMapActivity method readyToGo.

protected boolean readyToGo() {
    GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
    int status = checker.isGooglePlayServicesAvailable(this);
    if (status == ConnectionResult.SUCCESS) {
        if (getVersionFromPackageManager(this) >= 2) {
            return (true);
        } else {
            Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
            finish();
        }
    } else if (checker.isUserResolvableError(status)) {
        ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
    } else {
        Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
        finish();
    }
    return (false);
}
Also used : GoogleApiAvailability(com.google.android.gms.common.GoogleApiAvailability)

Example 9 with GoogleApiAvailability

use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.

the class AbstractMapActivity method readyToGo.

protected boolean readyToGo() {
    GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
    int status = checker.isGooglePlayServicesAvailable(this);
    if (status == ConnectionResult.SUCCESS) {
        if (getVersionFromPackageManager(this) >= 2) {
            return (true);
        } else {
            Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
            finish();
        }
    } else if (checker.isUserResolvableError(status)) {
        ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
    } else {
        Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
        finish();
    }
    return (false);
}
Also used : GoogleApiAvailability(com.google.android.gms.common.GoogleApiAvailability)

Example 10 with GoogleApiAvailability

use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.

the class AbstractMapActivity method readyToGo.

protected boolean readyToGo() {
    GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
    int status = checker.isGooglePlayServicesAvailable(this);
    if (status == ConnectionResult.SUCCESS) {
        if (getVersionFromPackageManager(this) >= 2) {
            return (true);
        } else {
            Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
            finish();
        }
    } else if (checker.isUserResolvableError(status)) {
        ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
    } else {
        Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
        finish();
    }
    return (false);
}
Also used : GoogleApiAvailability(com.google.android.gms.common.GoogleApiAvailability)

Aggregations

GoogleApiAvailability (com.google.android.gms.common.GoogleApiAvailability)21 Dialog (android.app.Dialog)1 DialogInterface (android.content.DialogInterface)1 Test (org.junit.Test)1