让我们从用户选择的商店安装应用程序

时间:2013-06-17 08:36:36

标签: android maps google-play

我目前正在中国开发应用程序。我有一个小问题,在中国手机谷歌地图最初没有安装,但我需要它的应用程序。对于用户来说,安装它没有问题,但我希望他们可以选择使用哪个市场。

public void someButtonClicked(View v) {

    if (!isGoogleMapsInstalled()){
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.google.android.apps.maps"));
        startActivity(intent);
    }
}
public boolean isGoogleMapsInstalled()
{
    try
    {
        ApplicationInfo info = getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0 );
        return true;
    }
    catch(PackageManager.NameNotFoundException e)
    {
        return false;
    }
}

这就是我所拥有的,实际上它只打开游戏商店,但我无法决定使用哪个商店。

最后抱歉我的英语不好。

0 个答案:

没有答案