定制进度对话框中的android? [英] custom Progress Dialog in android?

查看:114
本文介绍了定制进度对话框中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循 customdialog例如步骤在文档中,但我得到这个例外。任何想法?

  04-03 18:50:28.787:VERBOSE / Bru_ press_Tab(750):异常的Tabsjava.lang.RuntimeException:无法启动活动ComponentInfo {com.example。棕色/ com.example.brown.Bru_ press_MostRecent}:android.util.AndroidRuntimeException:requestFeature()必须在添加内容之前调用
 

解决方案

最有可能的,你是叫 requestWindowFeature()呼叫后的setContentView() 。这可能是你没有做直接,而是从继承的类,因为你正在做一些其他的事情稍微超出序列。

所以,找出你正在做的和改变,这样你拨打订购 requestWindowFeature()第一。

例如,这里是从一个示例项目我使用进度指示器 - 在最标题栏的技巧,因此书籍需要调用 requestWindowFeature()。我不得不这样做,在的onCreate()调用的setContentView()的活动之前。

I follow the steps in the customdialog example in the documentation, but I get this exception. Any ideas?

04-03 18:50:28.787: VERBOSE/Bru_Press_Tab(750): Exception in Tabsjava.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.brown/com.example.brown.Bru_Press_MostRecent}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content

解决方案

Most likely, you are calling requestWindowFeature() after calling setContentView(). It may be you are not doing that directly, but that classes you inherit from are, because you are doing some other things slightly out of sequence.

So, find out where you are doing that and change the order such that you call requestWindowFeature() first.

For example, here is a sample project from one of my books that uses the progress-indicator-in-the-title-bar trick and therefore needs to call requestWindowFeature(). I had to do that in onCreate() before calling setContentView() on the activity.

这篇关于定制进度对话框中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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