android 压力测试测出的bug 1C

自定义控件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

4个回答

把布局文件和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" />

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐