以编程方式列出意图过滤器 [英] Programmatically list intent-filters

查看:85
本文介绍了以编程方式列出意图过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在android活动中,有没有办法以编程方式列出其已注册的内容?

In an android Activity is there a way to programmatically list the it has registered for?

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

我正在尝试确定当前的活动是否是发射器.

I'm trying to determine if the current Activity is a LAUNCHER.

推荐答案

我认为程序包管理器会告诉您您要查找的内容.

I think the package manager will tell you what you're looking for.

http://developer.android.com/reference/android/content/pm/PackageManager.html

public abstract ActivityInfo getActivityInfo (ComponentName component, int flags)

标志可能包含的地方

GET_INTENT_FILTERS

这篇关于以编程方式列出意图过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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