How do I link from free to paid app in the Android market?

房东的猫 提交于 2019-12-03 09:51:58

问题


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?


回答1:


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);

Replacing uk.co.ashtonbrsc with a search term that will find your app.




回答2:


Even better to use "market://details" instead of "market://search":

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

Then it opens directly the details page of the app. With search it shows a single search result and the user has to do an additional click to get to the detail page.



来源:https://stackoverflow.com/questions/1646106/how-do-i-link-from-free-to-paid-app-in-the-android-market

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!