代码之家  ›  专栏  ›  技术社区  ›  TWA

在Android市场,我如何将免费应用程序链接到付费应用程序?

  •  7
  • TWA  · 技术社区  · 14 年前

    如果我在Android市场上有免费版本的付费应用程序,我怎么能在免费应用程序中放置一个按钮,打开市场上的付费版本?

    2 回复  |  直到 10 年前
        1
  •  15
  •   Intrications    14 年前

    将此添加到按钮的onclickListener的onclick方法:

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

    替代 uk.co.ashtonbrsc 有一个搜索词可以找到你的应用程序。

        2
  •  25
  •   uwe    13 年前

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

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

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