我正在尝试构建一个应用程序来接收来自 StumbleUpon 应用程序的分享。 此时,我可以接收浏览器的“共享 url”,但是当从 StumbleUpon 共享时,我的应用程序没有显示在列表中。
我在想我可能没有在 list 中注册正确的 Intents。 有什么方法可以找到该应用程序在做什么?
谢谢。
最佳答案
您可以从 logcat 中获得一些关于 Intent 的信息。当我在 StumbleUpon 中分享时,我在日志中注意到了这一点:
12-08 19:01:18.915: I/ActivityManager(139): Starting activity: Intent { act=android.intent.action.SEND typ=text/plain flg=0x3000000 cmp=com.google.android.gm/.ComposeActivityGmail (has extras) } from pid 4213
由此,我能够使用以下过滤器让应用程序显示在 StumbleUpon 共享列表中:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain"/>
</intent-filter>
关于java - 如何发现另一个应用程序的 Intent ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8357815/