-2
嗨,我是新來的android和Android鬧鐘應用程序的工作,我無法獲取數據時,我設置它應該插入數據庫中的時間。我試過了,但最後我得到了空。我無法將數據插入到我的sqlite數據庫表中。請提前幫我解決這個謝謝。您好,我沒有從我的一種方法獲取數據到其他在android中的其他?
public void onClick(View v) {
Calendar calNow = Calendar.getInstance();
Calendar calSet = (Calendar) calNow.clone();
calSet.set(Calendar.HOUR_OF_DAY, timePicker.getCurrentHour());
calSet.set(Calendar.MINUTE, timePicker.getCurrentMinute());
calSet.set(Calendar.SECOND, 0);
// calSet.set(Calendar.MILL ISECOND, 0);
if (calSet.compareTo(calNow) <= 0) {
// Today Set time passed, count to tomorrow
calSet.add(Calendar.DATE, 1);
}
// SQLiteDatabase mDB = null;
AlarmActivity mDbHelper;
// clearAll();
insertalarmclock();
Cursor c = readalarm();
// mAdapter = ;
setListAdapter(mAdapter);
onChecked(calSet);
setAlarm(calSet);
}
private void insertalarmclock() {
ContentValues values = new ContentValues();
values.put(this.KEY_HOUR, "Hour");
mDB.insert(this.KEY_HOUR, null, values);
values.clear();
values.put(this.KEY_MINUTE, "minute");
mDB.insert(this.KEY_MINUTE, null, values);
values.clear();
}
// private void clearAll() {
// SQLiteDatabase mDB = null;
// mDB.delete(MyDatabaseHelper.DATABASE_TABLE_NAME, null, null);
//
// }
private Cursor readalarm() {
return mDB.query(this.DATABASE_TABLE_NAME, this.minutes, null,
new String[] {}, null, null, null);
}
});
從哪個方法發送數據到哪個方法? – GrIsHu
對不起,我的英語請再次檢查問題嗎? –