Android:如何获取所有可用意图过滤器的列表? [英] Android: How to get a list of all available intent filters?

查看:23
本文介绍了Android:如何获取所有可用意图过滤器的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了 Android 文档,但出于某种疯狂的原因,我无法找到所有可用意图过滤器的列表.

我正在寻找一个意图过滤器,它可以通过广播接收器通知我一个特定的活动(例如浏览器或电子邮件)已经启动或在前台.

有人可以帮我吗?

解决方案

PackageExplorer 列出您设备中的应用程序中定义的所有意图过滤器

回答您的问题:您创建了一个或多个意图过滤器,以便在程序寻找服务或活动时选择您的活动.因此,包中的每个活动都定义了自己的意图过滤器列表.

我发现拥有一个由设备上所有应用程序定义的所有意图过滤器的列表很有用 - 这样就可以知道在处理意图时系统将调用哪些应用程序.我在 Android Market 上放了一个免费的应用程序,搜索Package Explorer",它会搜索它可以在您的设备上找到的所有应用程序,解码 AndroidManifest.xml 文件并显示所有应用程序定义的所有意图过滤器的列表.所有意图过滤器的表格可以按动作、类别、数据字段(即方案或 mimetype)、包名称或意图过滤器类型进行排序,以便您可以找到设备上响应各种动作或类别的所有活动.

Package Explorer 还会收集清单中的所有使用权限字段,并显示哪些应用需要哪些权限的列表.因此,您可以找到所有使用SEND_SMS"或类似内容的软件包.单击包的名称会显示该包的解码(未压缩的二进制)AndroidManifest.xml.

I have search Android docs and for some insane reason I am not able to find the list of all available intent filters.

I am finding an intent filter, which would do something like notifying me through Broadcast Receiver that a particular Activity (example browser, or email) has been started or in the foreground.

Can anyone help me with that?

解决方案

PackageExplorer lists all intent-filters defined in apps in your device

To answer your question: You create the intent-filter(s) you want to be used to cause your activity to be selected when a program is looking for a service or activity. So each Activity in a Package defines it own list of intent-filters.

I found it useful to have a list of all intent-filters defined by all the applications on a device -- so would know what apps the system would invoke when an intent was processed. I put a free app on Android Market, search for 'Package Explorer' that searches all apps it can find on your device, decodes the AndroidManifest.xml file and displays a list of all intent-filters defined by all apps. The table of all intent-filters can be sorted by Action, Category, Data fields(ie scheme or mimetype), package name or intent-filter type so you can find all Activites on your device that respond to various Actions or Categories.

Package Explorer also collects all uses-permissions fields in the manifest and displays a list of which apps require which permissions. So you can find all packages that use 'SEND_SMS' or something like that. Clicking on the name of a package displays the decoded (uncompressed binary) AndroidManifest.xml for the package.

这篇关于Android:如何获取所有可用意图过滤器的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆