HI Make try to use _id= column in where section.
On Wed, Apr 28, 2010 at 7:38 PM, mike <[email protected]> wrote: > hi Galbayar D, > > thanks for your help.it works fine and it has solve my issue. > appreciate what you have done. > > have another issue when a call is receiving how to delete the call log > entry. i have tried it but it always delete the other entries not the > current call entry. > this is my method > > public void clearCallLog() { > Cursor c = getContentResolver().query(Calls.CONTENT_URI, > null, > Calls.NUMBER + "='" + mobileNumber + "'", > null, > Calls.DATE + " DESC"); > getContentResolver().cancelSync(Calls.CONTENT_URI); > startManagingCursor(c); > String number = null; > String date; > int dateColumn = c.getColumnIndex(Calls.DATE); > int numberColumn = c.getColumnIndex(Calls.NUMBER); > if (c != null) { > if (c.moveToFirst()) { > // do { > // Get the field values > date = c.getString(dateColumn); > number = c.getString(numberColumn); > Log.d("NUmber", number); > Log.d("Date", date); > alert("number", number); > // } while (c.moveToNext()); > } > int i > =getContentResolver().delete(Calls.CONTENT_URI, > Calls.NUMBER + "='" + number + "'", > null); > alert("Delete", Integer.toString(i)); > } > } > > regards, > Randika > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- ============================== Tel:976-70151145 Fax:976-70151146 Mobile: 976-88115679 Web: http://www.usi.mn ============================== -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

