Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在谷歌游戏服务页面上打开游戏市场?_Java_Android_Android Intent_Google Play Services - Fatal编程技术网

Java 如何在谷歌游戏服务页面上打开游戏市场?

Java 如何在谷歌游戏服务页面上打开游戏市场?,java,android,android-intent,google-play-services,Java,Android,Android Intent,Google Play Services,我有一个应用程序,我需要通知用户他需要更新Google play services,并在play services应用程序页面上将他重定向到play Market。你能帮助我吗?提前谢谢你 将其放入您的清单中 <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 试试这个代码 final Str

我有一个应用程序,我需要通知用户他需要更新Google play services,并在play services应用程序页面上将他重定向到play Market。你能帮助我吗?提前谢谢你

将其放入您的清单中

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
试试这个代码

final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
 try {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
     }
       catch (android.content.ActivityNotFoundException anfe) {
       startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName)));
     }
final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
 try {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
     }
       catch (android.content.ActivityNotFoundException anfe) {
       startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName)));
     }