不显示“未安装 Google Play 服务无法运行该应用程序”的对话框。

3

我在我的应用程序中使用了Google Play服务,但它并不是运行所必需的。但是,当设备没有安装Google Play服务时,它会显示一个对话框,其中显示:此应用程序需要Google Play服务才能运行。

问题是,我可以更改这个文本吗?我找不到相关设置。

我的代码:

private boolean checkPlayServices() {
    GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
    int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
    if (resultCode != ConnectionResult.SUCCESS) {
        if (apiAvailability.isUserResolvableError(resultCode)) {
            apiAvailability.getErrorDialog(this, resultCode, 
                PLAY_SERVICES_RESOLUTION_REQUEST).show();
        } else {
            Log.i(TAG, "This device is not supported.");
            finish();
        }
        return false;
    }
    return true;
}

我猜您可以显示一个自定义对话框,而不是使用“ apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST).show(); ”。 - Valentin Kuhn
明白了,谢谢! - Dedeloper
我会将其作为答案发布 :) - Valentin Kuhn
1个回答

3
我猜你可以展示一个自定义对话框,而不是使用apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST).show();

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接