I have defined insert method for my table in android application as follow :
public long CreateBirthDay(long id,Date _date)
{
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_ID, id);
initialValues.put(KEY_Date, dateFormat.format(_date));
return mDb.insert(DATABASE_TABLE, null, initialValues);
}
But I dont know how to get date from cursor. I mean I cant complete the below code:
bc.SetID(mCursor.getLong(mCursor.getColumnIndex(KEY_ID)));
bc.SetDate(?);
Regards.
1 Answer