如何在 Android 市场中从免费应用程序链接到付费应用程序?
问题描述:
如果我在 Android 市场上有付费应用的免费版本,如何在免费应用中放置一个按钮来打开市场上的付费版本?
If I have a free version of a paid app in the Android market how can I place a button in the free app that opens the paid version in the market?
答
将此添加到按钮的 OnClickListener 的 onClick 方法中:
Add this to the button's OnClickListener's onClick method:
Intent marketLaunch = new Intent(Intent.ACTION_VIEW);
marketLaunch.setData(Uri.parse("market://search?q=uk.co.ashtonbrsc"));
startActivity(marketLaunch);
将 uk.co.ashtonbrsc
替换为可以找到您的应用的搜索词.
Replacing uk.co.ashtonbrsc
with a search term that will find your app.