-1
我有应用程序需要通知用户他需要更新Google Play服务并将其重定向到Play服务应用页面上的Play市场。你可以帮我吗?先谢谢你!如何在Google Play服务页面上打开Play Market?
我有应用程序需要通知用户他需要更新Google Play服务并将其重定向到Play服务应用页面上的Play市场。你可以帮我吗?先谢谢你!如何在Google Play服务页面上打开Play Market?
将此放在您的清单
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
这个代码在你的活动
// Check status of Google Play Services
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
// Check Google Play Service Available
try {
if (status != ConnectionResult.SUCCESS) {
GooglePlayServicesUtil.getErrorDialog(status, this, RQS_GooglePlayServices).show();
}
} catch (Exception e) {
Log.e("Error: GooglePlayServiceUtil: ", "" + e);
}
试试这个代码
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)));
}