【问题标题】:Starting an Spotify intent启动 Spotify 意图
【发布时间】:2012-10-08 20:17:11
【问题描述】:

我希望我的应用打开 Spotify 链接并将人们发送到该应用。如果安装了应用程序,这会产生奇迹:

final Intent intent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("spotify:album:7rt7AxYexFTtdEqaJPekvX"));

但是,在某些情况下,应用程序尚未安装,因此我希望他们以其他意图从 Google Play 下载它:

final Intent intent = new Intent(
                    Intent.ACTION_VIEW,
                    Uri.parse("https://play.google.com/store/apps/details?id=com.spotify.mobile.android.ui"));

但是,我真的希望它直接从 Google Play 安装,而不是让人们选择打开哪个应用程序……如果安装了 Google Play。如果缺少 Google Play,我希望他们选择打开哪个应用程序(通常是导航器,但无论如何)

有没有办法做到这一点?

【问题讨论】:

    标签: android android-intent spotify google-play


    【解决方案1】:

    但是,我真的希望它直接从 Google Play 安装,而不是让人们选择打开哪个应用

    使用market:// Uri 而不是https:// Uri: http://developer.android.com/distribute/googleplay/promote/linking.html

    另外,请仅在公开记录和支持的情况下使用 spotify: 方案。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-18
    • 2011-08-13
    • 1970-01-01
    相关资源
    最近更新 更多