java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="
来源:互联网 发布:手机解压软件 编辑:程序博客网 时间:2024/05/18 02:05
- Steps to reproduce the problem (including sample code if appropriate).Implement a Dialog(Maybe an Activity also has this issue. But I have not tested it.) using a customized theme which does not extends any of a Android basic theme. Such as: <style name="MyDialogTheme"> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowFrame">@null</item> <item name="android:backgroundDimEnabled">false</item></style>Also add a EditText into the dialog layout.Run the dialog on a Tablet(I used Galaxy Tab 10.1 with Android OS 3.1). Type some words into the EditText. Then double click the typed words.- What happened.Crashed with this exception message: java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="match_parent" (or fill_parent) at com.android.internal.widget.ActionBarContextView.onMeasure(ActionBarContextView.java:257) at android.view.View.measure(View.java:10840) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1284) at android.widget.LinearLayout.measureVertical(LinearLayout.java:613) at android.widget.LinearLayout.onMeasure(LinearLayout.java:519) at android.view.View.measure(View.java:10840) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4351) at android.widget.FrameLayout.onMeasure(FrameLayout.java:267) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2042) at android.view.View.measure(View.java:10840) at android.view.ViewRoot.performTraversals(ViewRoot.java:884) at android.view.ViewRoot.handleMessage(ViewRoot.java:2017) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:132) at android.app.ActivityThread.main(ActivityThread.java:4028) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:491) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) at dalvik.system.NativeStart.main(Native Method)- What you think the correct behavior should be.It should not crash and show OS selection UI to allow user to select words.It works before OS 3.0. So it is a backward compatibility issue.If it really need to throw a exception, at least we should get some information about why it happened more clearly.
Comment 1 by mr.polar...@gmail.com, Aug 3, 2011
- java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="
- java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layou
- java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layou
- java.lang.IllegalStateException: Hardware acceleration can only be used with a single UI thread.
- android R.java居然报错,Underscores can only be used with source level 1.7 or greater
- java.lang.IllegalStateException: Realm access from incorrect thread. Realm objects can only be acce
- android编译错误之“Hardware acceleration can only be used with a single UI thread”,硬件加速
- android.view.InflateException: <merge /> can be used only with a valid ViewGroup root and attachToRo
- @Field parameters can only be used with form encoding
- @Field parameters can only be used with form encoding
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- <merge /> can be used only with a valid ViewGroup root and attachToRoot=true
- [android studio]java.lang.IllegalStateException: ScrollView can host only one direct child
- java.lang.IllegalStateException: ScrollView can host only one direct child
- java.lang.IllegalStateException: ScrollView can host only one direct child
- Android Bitmap 改变的时候可能会抛出 java.lang.IllegalStateException: only mutable bitmaps may be reconfigured
- Android Bitmap 会抛出 java.lang.IllegalStateException: only mutable bitmaps may be reconfigured
- java.lang.IllegalArgumentException: FormUrlEncoded can only be specified on HTTP methods with requ
- Select-下拉列表选择插件(包含下拉选择图片,下拉grid等)
- 认识服务器操作系统
- js 数组操作
- 解压缩版tomcat环境变量配置
- Jack Dorsey
- java.lang.IllegalStateException: ActionBarContextView can only be used with android:layout_width="
- 设置IIS延长Debug
- hdu1316 How Many Fibs?(大数)
- ASP.NET程序也能像WinForm程序一样运行
- flex与java交互:RemoteObject
- JS Date格式化为yyyy-mm-dd类字符串
- 10月28日 总结前些天
- mysql 的table合并
- .NET程序编译版本维护