- 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.
Comment1bymr.polar...@gmail.com, Aug 3, 2011
If I modify the style as below. It will not crash.<style name="MyDialogTheme" parent="@android:style/Theme.Dialog">        <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>

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android活动的四种启动模式
  2. Android(安卓)热修复框架 AndFix (一)
  3. Android 如何在App中启动系统闹钟
  4. Android(安卓)路由框架
  5. Android 编程 设计规范
  6. Android 4.2.2原生Launcher修改使之可以
  7. Listview的onItemClickListener无法响应
  8. Android开发实践 事件处理机制 全面分析
  9. 探究 Android(安卓)View 绘制流程,Activit
  10. Android之view重绘