How to add my custom View to layout in xml?
<p>There is the following xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" &gt;

    &lt;com.ulnda.calendarapplication.MyCalendarView
        android:id="@+id/calendarView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>MyCalendarView:</p>

<pre><code>public class MyCalendarView extends CalendarView {

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

    @Override
    public void setOnClickListener(OnClickListener listener) {
//      View v;
//      v.setOn

    }

    @Override
    public boolean performClick() {
        Log.e("event", "perform_click");
        return true;
    }
}
</code></pre>

<p>All is good, but when I'm trying to execute this application I'll have got the following message:</p>

<pre><code>10-19 12:59:30.037: E/AndroidRuntime(30968): FATAL EXCEPTION: main
10-19 12:59:30.037: E/AndroidRuntime(30968): android.view.InflateException: Binary XML file line #7: Error inflating class com.ulnda.calendarapplication.MyCalendarView
</code></pre>

<p>How can I fix it?</p>
