自定义控件MyButton,已经实现了三个构造函数,希望哪位大神帮帮忙查看下,给些意见,感激不尽
FATAL EXCEPTION: main
01-02 00:32:39.600 E/AndroidRuntime( 6275): Process:
com.simple.zjx.main, PID: 6275
01-02 00:32:39.600 E/AndroidRuntime( 6275): java.lang.RuntimeException: Unable
to start activity
ComponentInfo{com.simple.zjx.main/com.simple.zjx.main.MysimpleMain}:
android.view.InflateException: Binary XML file line #25: Error inflating class
com.simple.zjx.main.custom.button.MyButton
01-02 00:32:39.600 E/AndroidRuntime( 6275): Caused by:
android.view.InflateException: Binary XML file line #25: Error inflating class
com.simple.zjx.main.custom.button.MyButton
01-02 00:32:39.600 E/AndroidRuntime( 6275): Caused by:
java.lang.reflect.InvocationTargetException:
01-02 00:32:39.600 E/AndroidRuntime( 6275): at
java.lang.reflect.Constructor.constructNative(Native Method)
01-02 00:32:39.600 E/AndroidRuntime( 6275): at
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
01-02 00:32:39.600 E/AndroidRuntime( 6275): at
android.view.LayoutInflater.createView(LayoutInflater.java:594)
01-02 00:32:39.600 E/AndroidRuntime( 6275): ... 21 more
把布局文件和3个构造都贴出来看看
布局文件的第25行有问题
25 26 android:id="@+id/button"
27 android:layout_width="@dimen/workspace_width"
28 android:layout_height="@dimen/workspace_height" />
25 android:id="@+id/button"
android:layout_width="@dimen/workspace_width"
android:layout_height="@dimen/workspace_height" />