问题描述

com.android.vending
com.android.vending
versionCodeversionName
versionCodeversionName
versionCodeversionName
versionCodeversionName

如果有人知道任何其他检测方法,请告诉我.

If anyone knows any other way of detecting this let me know.

推荐答案

packageInfo
packageInfo
public static boolean isGooglePlayInstalled(Context context) {
    PackageManager pm = context.getPackageManager();
    boolean app_installed = false;
    try
    {
           PackageInfo info = pm.getPackageInfo("com.android.vending", PackageManager.GET_ACTIVITIES);
           String label = (String) info.applicationInfo.loadLabel(pm);
           app_installed = (label != null && !label.equals("Market"));
    }
    catch (PackageManager.NameNotFoundException e)
    {
           app_installed = false;
    }
    return app_installed;
}

这篇关于如何检测是否安装了 Google Play?(不是市场)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2