你可以用
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:com.google.somepackage")));
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="market" android:host="search" />
</intent-filter>
这样可以直接发起 不会给你提示
或者直接在你的activity中加入
由此可以判断 有没有市场程序
<intent-filter android:priority="100">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="market.android.com" android:path="/search" />
<data android:scheme="market"
android:host="search" android:path="" />
</intent-filter>
如果不加红色部分的优先权 你是很难捕获或者就是捕获不到 市场程序的网址 也就是说你启动不了浏览器打开那个网页
这个呢 目前来说 已经有人把它作为一个bug提交到官方网站 所以加入优先权 可以暂时解决
这是我们启用网址时 要学会的嗷