我从数据库中获取日期请参阅数据库:
我在数组列表中输入日期我想检查当前日期是否存在于数组列表中然后打印当天的标题我将如何做到这一点?
static ArrayList<String> Vacation_ID = new ArrayList<String>();
static ArrayList<String> Vacation_name = new ArrayList<String>();
static ArrayList<String> Vacation_Date = new ArrayList<String>();
Cursor mCursor3 = db.selectQuery("SELECT * FROM uss_vacation WHERE calendar_id =
'"+Calendar_id+"' ");
if (mCursor3.moveToFirst()) {
do {
Vacation_ID.add(mCursor3.getString(mCursor3.getColumnIndex("id")));
Vacation_name.add(mCursor3.getString(mCursor3.getColumnIndex("title")));
Vacation_Date.add(mCursor3.getString(mCursor3.getColumnIndex("date")));
} while (mCursor3.moveToNext());
}
mCursor3.close();
now i want to check if current date exist in araylist Vacation_Date show title
of that date like
if (Vacation_Date.contains("2013-11-11")) {
string datetitle;
datetitle="Veterans Day" from database