我的目标是从我的日历中取出所有日历事件,并由我正在寻找的与会者过滤它。换句话说,我希望 Mayer 先生参加的所有活动我已经解决了这个问题以获取我的活动。我的光标中有它们 curCalendar 但是如何通过与会者电子邮件过滤 curCalendar?我正在考虑创建一个包含所有事件 ID 的数组,或者我是否可以删除光标 curCalendar 的行。嗯,我需要帮助。如何通过特殊的与会者电子邮件过滤我的 curCalendar...
if(!strEmailFilter.isEmpty()){
//there is an Email Filter - look for a special Attendee within all Events...
curCalendar.moveToFirst();
index = curCalendar.getColumnIndex(CalendarContract.Events._ID);
strEventId = curCalendar.getString(index);
strEmail = openCalendar.getEmailfromAttendee(this, strEventId);
Integer i= 0;
if (strEmail.equals(strEmailFilter)){
//Attendee email is equal to filter email
//Add row to CurCalendarGefiltert
strEventsGefiltert [i] = strEventId;
}
while (curCalendar.moveToNext()) {
i = i +1;
index = curCalendar.getColumnIndex(CalendarContract.Events._ID);
strEventId = curCalendar.getString(index);
strEmail = openCalendar.getEmailfromAttendee(this, strEventId);
if (strEmail.equals(strEmailFilter)){
strEventsGefiltert [i] = strEventId;
// curCalendarGefiltert.
}
}
}
MyCalendarAdapter myCalendaradapter = new MyCalendarAdapter (
this,
R.layout.terminzeile_google,
curCalendar,
new String[] {CalendarContract.Events.TITLE, CalendarContract.Events.DESCRIPTION},
new int[] {R.id.textViewTitle, R.id.textViewProjekt}
);
/*
myClientsadapter.setViewBinder(new MyDataAdapter.ViewBinder() {
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
if(columnIndex == 13) {
String strBeginn = cursor.getString(columnIndex);
CheckBox cb = (CheckBox) view;
int intbezahlt = cursor.getInt(13);
cb.setChecked(intbezahlt > 0);
return true;
}
String str = cursor.getString(columnIndex);
return false;
}
});
*/
listViewTermine.setAdapter(myCalendaradapter);