gpt4 book ai didi

Android请求窗口功能

转载 作者:行者123 更新时间:2023-11-29 18:10:47 25 4
gpt4 key购买 nike

在我的单个 Activity 屏幕上的应用程序中,我想请求以下两个窗口功能:

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 
requestWindowFeature(Window.FEATURE_LEFT_ICON);

一次添加一个时两者都在工作,但是当我将它们两个加在一起时它们都不起作用。

请建议我们如何在android中做到这一点?

编辑
我的 Activity 代码
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Log.v("TAG", "After super.onCreate()");
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
Log.v("TAG", "after Window.FEATURE_INDETERMINATE_PROGRESS");
requestWindowFeature(Window.FEATURE_LEFT_ICON);
Log.v("TAG", "after Window.FEATURE_LEFT_ICON");
setContentView(R.layout.categotylist);
Log.v("TAG", "after setContentView");
lists = new ArrayList<String>();
\\some more code
}

日志猫
06-02 13:02:37.813: D/Prototype(421): ViewPagerActivityActivity : LOADING CATEGORY
06-02 13:02:38.092: D/dalvikvm(421): GC_FOR_MALLOC freed 7300 objects / 470264 bytes in 59ms
06-02 13:02:38.112: I/global(421): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
06-02 13:02:38.982: V/TAG(421): After super.onCreate()
06-02 13:02:38.982: V/TAG(421): after Window.FEATURE_INDETERMINATE_PROGRESS
06-02 13:02:38.992: V/TAG(421): after Window.FEATURE_LEFT_ICON
06-02 13:02:39.172: V/TAG(421): after setContentView

最佳答案

你试着让你的requestWindowFeature() call before you call setContentView()?
看到这个Android Developer site

关于Android请求窗口功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10848688/

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