Search in sources :

Example 1 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 2 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 3 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 4 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 5 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)20 Dialog (android.app.Dialog)1 DialogInterface (android.content.DialogInterface)1 Test (org.junit.Test)1