How to discover another app's intent

五迷三道 提交于 2019-12-23 12:00:41

问题


I'm trying to build an app to receive shares from the StumbleUpon app. I can, at this point, receive the browser's "share url", but when sharing from StumbleUpon my app does not show up on the list.

I'm thinking that I may not have registered the correct Intents in the manifest. Is there any way to find what that app is doing?

Thanks.


回答1:


You can get a bit of information about intents from logcat. When I shared in StumbleUpon I noticed this in the log:

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

From that, I was able to get an app to show up in the StumbleUpon share list with the following filter:

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


来源:https://stackoverflow.com/questions/8357815/how-to-discover-another-apps-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!