What is the package name of the Android Market or Google Apps

后端 未结 2 1257
时光取名叫无心
时光取名叫无心 2020-12-17 21:15

I need to check if the Android Market is installed like this

    /*
     * Test for existence of Android Market
     */
    boolean androidMarketExists = fal         


        
2条回答
  •  猫巷女王i
    2020-12-17 21:46

    It's com.android.vending (on my Galaxy S), and here's the better way to find out... by querying for who handles market:// URIs.

        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("market://search?q=foo"));
        PackageManager pm = getPackageManager();
        List list = pm.queryIntentActivities(intent, 0);
    

    If the list has at least one entry, the Market's there.

提交回复
热议问题