public int ReadSmsCounter(long lastSyncTime)
{
try
{
Uri uriSMS = Uri.parse(SMS_URI);
Cursor cur = context.getContentResolver().query(uriSMS, null, null, null, "date ASC");
cur.moveToLast();
//while
String protocol = cur.getString(cur.getColumnIndex("protocol"));
if(protocol == null)
{
Log.i(TAG, "SMS SEND");
int threadId = cur.getInt(cur.getColumnIndex("thread_id"));
Log.i(TAG, "SMS SEND ID = " + threadId);
Cursor c = context.getContentResolver().query(Uri.parse("content://sms/outbox/" + threadId), null, null, null, null);
c.moveToLast();
int person = cur.getInt(cur.getColumnIndex("person"));
Log.i(TAG, "SMS SEND person= " + person);
String address = cur.getString(cur.getColumnIndex("address"));
Log.i(TAG, "SMS SEND address= " + address);
String date = cur.getString(cur.getColumnIndex("date"));
Log.i(TAG, "SMS SEND date= " + date);
String body = cur.getString(cur.getColumnIndex("body"));
Log.i(TAG, "SMS SEND body= " + body);
質問があります。時間と比較して時間を同期したい。synctime
とdate-time
がtrue
の場合、カウンターは増加するはずです。助けてthx