gpt4 book ai didi

android - 以编程方式列出 Intent 过滤器

转载 作者:太空狗 更新时间:2023-10-29 14:28:07 27 4
gpt4 key购买 nike

在 android Activity 中有没有办法以编程方式列出它已注册的 Activity ?

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

我正在尝试确定当前 Activity 是否是 LAUNCHER。

最佳答案

我想包管理器会告诉你你在找什么。

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

public abstract ActivityInfo getActivityInfo (ComponentName component, int flags)

标志可能包含

GET_INTENT_FILTERS

关于android - 以编程方式列出 Intent 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9814989/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com