FATAL EXCEPTION: main
Process: com.tissmarthome, PID: 14674
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tissmarthome/caro.automation.dialog.AddRoomDialog}: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:806)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:464)
at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6129)
at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:1831)
at android.widget.TableLayout$LayoutParams.<init>(TableLayout.java:692)
at android.widget.TableLayout.generateLayoutParams(TableLayout.java:640)
at android.widget.TableLayout.generateLayoutParams(TableLayout.java:74)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:400)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
at android.app.Activity.setContentView(Activity.java:1946)
at caro.automation.dialog.AddRoomDialog.onCreate(AddRoomDialog.java:12)
at android.app.Activity.performCreate(Activity.java:5248)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
... 11 more
------解决思路----------------------
Can't convert to dimension: type=0x12
同意楼上,估计是在xml里属性赋值错误或引用错误,比如使用1的赋值了1dp之类
------解决思路----------------------
楼主去这个网站看看http://www.tuicool.com/articles/rErMzm
------解决思路----------------------
Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension 在布局资源中看下那些设置宽高、边距的值
------解决思路----------------------
代码最好能贴全一些