1
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); 

我有个问题。我想将时间与时间进行比较。如果 synctimedate-timeare true,计数器应该增加。谢谢帮助

4

0 回答 0