0
데이터베이스에 레코드를 삽입 할 때 날짜가 Date Picker
인 쿼리를 실행할 수 있도록 레코드가 삽입 된 날짜 스탬프를 넣고 싶습니다. 이것은 무엇 날짜로 데이터베이스 레코드 저장
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DAY_OF_MONTH);
int month = cal.get(Calendar.MONTH);
cal.set(year, month, day);
long mDate = cal.getTimeInMillis();
mDate를 삽입 할 때 내가 타임 스탬프를 얻는 방법이다 그때 그 날의 항목에 대한 쿼리를 실행할 때이
public DateList(Calendar date){ //constructor
dt = date.getTimeInMillis();
}
로더을
@Override
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
return new CursorLoader(getActivity(),Games.GAMES_URI,new String[] {Games.GAMES_ID},Games.GAMES_DATE + "=" +dt ,
null,null);
}
그러나 date picker
의 날짜가 삽입 된 타임 스탬프와 일치하지 않습니다. 올바른 날짜가 선택되면 왜 안 되니?
예를 들어 무엇을 의미하는지 이해하지 못합니다. – tyczj