send sms for a missed calls
<p>i would like to develop an app that send a message when ever that receives a missed 
    call.but i have a problem when ever i start that activity that send the sms to previous 
    ones how to solve this problem,i have a small idea a set that particular missed call as 
    read or delete it other wise my app has to access the missed the missed calls i a 
    specific peroid of time
   try{</p>

<pre><code>        cursor = getContentResolver().query(
                Uri.parse("content://call_log/calls"),
                projection,
                selection,
                selectionArgs,
                sortOrder);
       // cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.MISSED_TYPE));
        while (cursor.moveToNext()) { 
            String callLogID = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls._ID));
            String callNumber = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.NUMBER));
            String callDate = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.DATE));
            String callType = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.TYPE));
            String isCallNew = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.NEW));
            //String missedcall= cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.MISSED_TYPE));
            /*if(Integer.parseInt(callType) == android.provider.CallLog.Calls.MISSED_TYPE &amp;&amp; Integer.parseInt(isCallNew) &gt; 0){
               tv.append("hai");
                //if (_debug) Log.v("Missed Call Found: " + callNumber);
            }*/

            if(cursor.getString(cursor.getColumnIndexOrThrow(android.provider.CallLog.Calls.TYPE)).equalsIgnoreCase("3") &amp;&amp; Integer.parseInt(isCallNew)&gt;0)
            {
                tv.append("ok"+callNumber+"\n");
                sm.sendTextMessage(callNumber, null, " iam in work i will call you later", null, null);
            }
        }
    }catch(Exception ex){
        //if (_debug) Log.e("ERROR: " + ex.toString());  
</code></pre>
