有以下xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.ulnda.calendarapplication.MyCalendarView
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
我的日历视图:
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;
}
}
一切都很好,但是当我尝试执行此应用程序时,我会收到以下消息:
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
我该如何解决?