gpt4 book ai didi

java - 安卓 : is it possible to call requestFeature() after setContentView ?

转载 作者:行者123 更新时间:2023-12-02 05:36:13 25 4
gpt4 key购买 nike

我想在使用 setContentView() 加载 View 后调用 requestFeature(),但错误非常明显:

android.util.AndroidRuntimeException: requestFeature() must be called before adding content

没有办法直接在 Activity 中调用 requestFeature() 吗?

最佳答案

来自开发者网站关于 requestFeature() :

Enable extended screen features. This must be called before setContentView(). May be called as many times as desired as long as it is before setContentView(). If not called, no extended features will be available. You can not turn off a feature once it is requested. You canot use other title features with FEATURE_CUSTOM_TITLE.

所以简单的答案是否定的。

关于java - 安卓 : is it possible to call requestFeature() after setContentView ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24939170/

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