Android View inflateException

后端 未结 1 1780
误落风尘
误落风尘 2021-01-14 01:00

I\'m trying to create a custom view - finger paint, and I\'m having trouble with this error and I don\'t know how to fix it. Can anybody tell me what is wrong?

LogCa

相关标签:
1条回答
  • 2021-01-14 01:37

    From the posted Logcat output:

    Caused by: android.view.InflateException: Binary XML file line #9: 
                                               Error inflating class com.boenka.mk.DrawPanel
    ....
    ....
    Caused by: java.lang.ClassNotFoundException: com.boenka.mk.DrawPanel
    

    It seems that you have accidentally misspelled the custom view's name in your xml layout file:

    <com.boenka.mk.DrawPanel
        android:id="@+id/signatureview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />
    

    See if changing com.boenka.mk.DrawPanel to com.boenka.mk.DrawingPanel fixes the problem.

    0 讨论(0)
提交回复
热议问题