我已使用以下代码打开Google Play商店
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=my packagename "));
startActivity(i);.
Run Code Online (Sandbox Code Playgroud)
但它显示了一个完整的动作视图,以选择选项(浏览器/播放商店).我需要直接在Play商店中打开应用程序.
在他们为谷歌播放服务提供的示例中,他们处理可能的版本更新,如下所示:
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(from);
if (resultCode != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
GooglePlayServicesUtil.getErrorDialog(resultCode, context,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
error(TAG, "this device is not supported");
}
Run Code Online (Sandbox Code Playgroud)
这会产生类似的消息
"如果您不更新Google服务,您的应用程序将无效".
对于我的应用程序,这个语句太强大,因为我只使用服务来提供一些oprional功能.
我能以某种方式GooglePlayServicesUtil.getErrorDialog()用我自己的对话替换对话吗?
理想情况下,我希望有类似的东西
"Google服务更新是可取的.是/否"