gpt4 book ai didi

android - android :enabled mean for an application?是什么意思

转载 作者:行者123 更新时间:2023-12-04 23:58:16 25 4
gpt4 key购买 nike

我想弄清楚 android 文档中的这个描述指的是什么类型的组件。为什么 android 系统会尝试在我的应用程序中实例化组件?

android:启用

Whether or not the Android system can instantiate components of the application — "true" if it can, and "false" if not. If the value is "true", each component's enabled attribute determines whether that component is enabled or not. If the value is "false", it overrides the component-specific values; all components are disabled. The default value is "true".

最佳答案

Why would the android system try to instantiate components inside my application?

每次您的应用组件运行时,它都会由系统实例化,唯一的异常(exception)是通过 registerReceiver() BroadcastReceiver。因此,例如,每次对您的某个 Activity 调用 startActivity() 时,系统都会实例化您的组件。

现在,如果您的问题是“好吧,为什么他们要在应用程序级别使用 android:enabled?”,我无法解释。我一直怀疑他们有一个愿景,很久以前,一个 APK 可以容纳多个应用程序,尽管这从未得到支持。 FWIW,我已经提交了a documentation issue关于这一点。

关于android - android :enabled mean for an application?是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18090663/

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