Android:如何比较同步时间

时间:2013-06-26 08:43:59

标签: android sync

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

我有一个问题。我希望将时间与时间进行比较。如果同步timedate-timetrue,则计数器应该增加。 请求帮助

0 个答案:

没有答案