如何在安卓市场中从免费应用链接到付费应用?

7
如果我在Android市场上有一个免费版本的付费应用,如何在免费应用中放置一个按钮,以打开市场上的付费版本?
2个回答

25

最好使用"market://details"而不是"market://search":

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.android.example"));
startActivity(intent);

接着它会直接打开应用程序的详细页面。在搜索中,它只显示单个搜索结果,用户必须再点击一次才能进入详细页面。


15

将此代码添加到按钮的 OnClickListener 的 onClick 方法中:

Intent marketLaunch = new Intent(Intent.ACTION_VIEW);
marketLaunch.setData(Uri.parse("market://search?q=uk.co.ashtonbrsc"));
startActivity(marketLaunch);

用一个能够找到你的应用程序的搜索词替换uk.co.ashtonbrsc


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接