这是在选定日期内获取SMS日志的代码,但它返回空光标:
long lFrom = login.getTime();
long lTo= logout.getTime();
String[] whereValue = {String.valueOf(lFrom),String.valueOf(lTo)};
Cursor cursor = this.getContentResolver().query(allMessages, new String[]{"date", "type", "address"},
Telephony.Sms.DATE + " BETWEEN ? AND ?", whereValue, null);