【问题标题】:Want to listed my app on android app chooser dialog when user click on any link from different app当用户单击来自不同应用程序的任何链接时,想要在 android 应用程序选择器对话框中列出我的应用程序
【发布时间】:2019-09-12 08:22:07
【问题描述】:

我想在应用程序选择器对话框中列出我的应用程序(例如,当我们单击任何链接时,选择器对话框中会显示谷歌、Mozilla)并且它非常有效,但是当我从 youtube 中单击任何链接时,它不会显示我的应用程序在 Android 选择器对话框中。

我的清单文件代码是:-

<activity
            android:name=".mvp.BroswerActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="stateAlwaysHidden|stateHidden"
            android:launchMode="singleTask">


        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="http" android:host="developer.android.com"/>
            <data android:scheme="http" android:host="*"/>
            <data android:scheme="https" android:host="*"/>

        </intent-filter>

 </activity>

当我们点击任何其他网站时它正在工作,但如果 youtube 不工作。

我也尝试在我的代码中添加共享意图,但没有运气解决这个问题。

 <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="image/*" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE" />
                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="image/*" />
            </intent-filter>

请建议我可以做些什么来解决这个问题。

提前致谢。

【问题讨论】:

  • in case of youtube is not working 你到底在 youtube 上做什么?
  • 你好 Vladyslav 我只想当用户点击 youtube 中的任何链接时,我的应用程序也会在 android 选择器对话框中与 google、Mozilla 一起列出。
  • @ShubhamAgarwal 使用 @Vladyslav 回复,否则我不会收到通知,也永远不会知道您回复了。 link in youtube youtube-什么?网站,还是 youtube 应用程序?
  • @Vladyslav,感谢您的指导,我已经在 youtube 应用中尝试过。

标签: android android-manifest deep-linking


【解决方案1】:

YouTube 会发送带有 ACTION_SHAREtext/plain 意图,除非您是在谈论分享视频。所以很明显它不会显示任何ACTION_VIEW意图。

【讨论】:

  • 我还在代码中添加了 ACTION_SHARE 意图,但它不起作用。
猜你喜欢
  • 1970-01-01
  • 2019-08-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-28
相关资源
最近更新 更多