SMSObserver: change from moveToNext to move(int offset) or moveToPosition(int position) in order to reach a specific index
<pre><code>  public void onChange(boolean selfChange) {
        Log.e("Info","Notification on SMS observer");
        Cursor sms_sent_cursor = mContext.getContentResolver().query(SMS_STATUS_URI, null, null, null, null);
           if(sms_sent_cursor.moveToNext()){ //This is the line I would like to change.
                 String protocol = sms_sent_cursor.getString(sms_sent_cursor.getColumnIndex("protocol"));

           }

  }
</code></pre>

<p>Well the thing is, while my application is running doing some other activities the ContentObserver stays active observing the SMSs activities, but if for example 5 SMSs are sent while my application is doing some other activities, the Observer waits for the activities to be done (since it probably uses one thread) so it can be called. But the problem is when it is called and the method calls <code>sms_sent_cursor.moveToNext()</code> is gonna call the Last SMS and the other fours are gonna be ignored.</p>

<p>That's why I was thinking about changing from <code>moveToNext()</code> to <code>move(int offset)</code> or <code>moveToPosition(int position)</code> </p>

<p>But I don't know what to put as parameter of these methods to go to a specific message, the one which it was called and not the last one.</p>

<p>Anyone have any idea or know any other way to do this?</p>

<p>Thanks!</p>
