【问题标题】:How to launch Market App with market URL through App Widget如何通过 App Widget 启动具有市场 URL 的市场应用程序
【发布时间】:2012-01-24 15:34:57
【问题描述】:

我想通过单击应用小部件上的图像按钮来使用市场应用启动我的应用的详细信息页面。在引用此链接http://developer.android.com/guide/publishing/publishing.html#marketintent

后,我使用以下代码进行了尝试
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market.android.com/details?id=com.abc.abcdef"));
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.rateme, pendingIntent);

但每次我点击小部件上的图像按钮时,我都会在 logcat 中收到以下消息

开始活动:Intent { act=android.intent.action.VIEW dat=market.android.com/details?id=com.abc.abcdef flg=0x10000000 bnds=[22,243][166,385] } 来自 pid -1

没有成功推出市场申请。 如果有人对此问题有解决方案,请与我分享。 谢谢, SKU

【问题讨论】:

    标签: android android-widget google-play


    【解决方案1】:

    试试这个setData()

    intent.setData(Uri.parse("market://details?id=com.abc.abcdef"));
    

    http://developer.android.com/guide/publishing/publishing.html#OpeningDetails

    【讨论】:

    • 谢谢弗拉基米尔,我没有意识到我以错误的方式使用了 URL。它奏效了。
    猜你喜欢
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-12
    • 2021-10-30
    • 2011-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多