【问题标题】:Sharing from Android spotify to my app从 Android spotify 共享到我的应用
【发布时间】:2015-08-29 20:10:08
【问题描述】:

我希望使用 Spotify Android 应用上的“发送至”功能在共享对话框中显示我的应用。

但是,我不知道我必须添加什么到我的 Intent 过滤器中才能让我的应用显示在那里

这是我当前的意图过滤器

        <intent-filter>
            <action android:name="android.intent.action.SENDTO"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:scheme="sms" />
            <data android:scheme="smsto" />
        </intent-filter>
        <!-- filter for sending text or images; accepts SEND action and text or image data -->
        <intent-filter>
            <action android:name="android.intent.action.SEND"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="image/*"/>
            <data android:mimeType="text/plain"/>
        </intent-filter>

【问题讨论】:

    标签: android android-intent spotify


    【解决方案1】:

    首先你必须知道你在分享什么,取决于Spotify中的Share to你必须添加一个mimeType我以为是音频或视频,所以我用了这个让我知道如果成功了。

    <data android:mimeType="video/*" android:scheme="http" /> 
    <data android:mimeType="audio/*" android:scheme="http" />
    

    查看MIMEtype list,这可能会对您有所帮助。

    只是想知道,如果你想做,如果你做得很好,试着把这个mimrType

    <data android:mimeType="*/*" />
    

    【讨论】:

    • 在我看来应该是 text/plain 。我基本上是在分享曲目的 URL。我试过了,但是没有用
    • 你试过text/*,或者如果它是一个URL,试试text/html
    • 那我没主意了,清理并重建你的项目
    • @cjds 解决了您的问题?还是我还要调查?
    • 不。你可以试试调查。我会对任何解决方案感兴趣,但我还没有想出/看到任何解决方案
    猜你喜欢
    • 2016-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-08
    • 1970-01-01
    • 1970-01-01
    • 2015-06-28
    相关资源
    最近更新 更多