0

カスタムビューを作成しましたMyView:

package com.example;

public class MyView extends View {

    public MyView(Context context) {
        super(context);
    }
}

そしてそれをレイアウトxmlで使用します:

<com.example.MyView android:id="@+id/imageView"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent">
</com.example.MyView>

エラーがスローされます:

09-02 16:43:07.114: ERROR/AndroidRuntime(1387): FATAL EXCEPTION: main
        java.lang.RuntimeException: Unable to start activity 
        ComponentInfo{com.example/com.example.MyActivity}: android.view.InflateException: Binary XML file line #13:
           Error inflating class com.example.MyView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
        at android.app.ActivityThread.access$1500(ActivityThread.java:117)

修正方法は?

4

1 に答える 1