Android 如何使用日历视图将文本信息附加到特定日期

Android 如何使用日历视图将文本信息附加到特定日期,android,android-intent,android-activity,calendar,Android,Android Intent,Android Activity,Calendar,我将日历视图添加到我的黑色活动中 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_

我将日历视图添加到我的黑色活动中

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Homepage">

<CalendarView
    android:id="@+id/calender_view"
    android:onClick="hoursLog"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


</CalendarView>

您可以检查并使用自定义适配器Calendar():

DateModel.class

private String mTextNote;
 private Date mDateChoose;
 public String getTextNote(){return mTextNote};
 public Date getDateChoose(){return mDateChoose};
 public void setTextNote(String textNote){mTextNote = textNote;};
 public void setDateChoose(String dateChoose){mDateChoose = dateChoose;};
之后:我点击calendar,检查calendar==getDateChoose;显示文本注释

private String mTextNote;
 private Date mDateChoose;
 public String getTextNote(){return mTextNote};
 public Date getDateChoose(){return mDateChoose};
 public void setTextNote(String textNote){mTextNote = textNote;};
 public void setDateChoose(String dateChoose){mDateChoose = dateChoose;};