How delete a particular call log from call log list

by Gulfam » Thu, 12 Mar 2009 15:33:36 GMT


Sponsored Links
 Hi,

   I have deleted whole call log by the following statement
context.getContentResolver().delete
(CallLog.Calls.CONTENT_URI,null,null);

but i am facing problem to delete particular call log from call log
list by the following code any one can help me.
 if any one have successfully delete particular call log please change
in my following code i want to delete that numbers form call log that
starts with + or 00 its urgent.

Uri   delUri = Uri.withAppendedPath(CallLog.Calls.CONTENT_URI,"");
Cursor cursor =      context.getContentResolver().query
(delUri,null,null,null,null);

                                                                
context.getContentResolver().delete
(delUri,"_id="+cursor.getCount(),null);

Thanks & Regards,
Gulfam
--~--~---------~--~----~------------~-------~--~----~



How delete a particular call log from call log list

by Eric » Fri, 13 Mar 2009 01:43:04 GMT


 You need to iterate through your Cursor and get the _id values of the
entries you want to delete (the ones who number starts with + or 00).
Then you can delete that individual entries.

// assume the row you want to delete has an _id value of 2
getContentResolver().delete(delUri, "_id=2", null)


What you were doing was incorrect because  you were setting the _id to
cursor.getCount() which doesn't make sense.

  Eric





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. (WTAsk) Setting Network 3G Only HD2 ROM Jaws MIUI

Sesuai Subject, untuk HD2 saya menggunakan ROM Jaws MIUI.
Yang menjadi masalah adalah untuk setting nettwork tidak ada pilihan 3G Only.
Pake sim card tsel di network muncul 3G dan H. 
Pake sim card Isat dinetwork hanya muncul E atau G. Sim Card Isat pindah ke X10 
sama muncul E atau G, karena di X10 ada setting network 3G only jadinya bisa 
manual ke network 3G.

Apa ada trik or tips supaya bisa ke 3G Only di HD2 ?

Thanks B4

-- 
===============
"

2. Help inject Flexi ke Droid X belum bisa Call dan SMS, sinyal udah dapet

Salam kenal sebelumnya,

Sedikit curcol , udah 2 hari ngubek2 motorola droid X buat diinject
flexi pakai tutorial di :

http://brian-marjunani.blogspot.com/2010/07/motorola-droid-guide-inject-flexi.html

dengan beberapa penyesuaian soalnya pake droid X.

Tapi sampe sekarang belum berhasil, padahal :

sinyal udah dapet , PRL udah 300 (pernah coba 360 juga), settingan NAM
sudah dicoba dari tutorial diatas tapi tetep saja belum bisa call dan
SMS , mohon bantuannya :
status
network masih unknown, mobile network state : disconnected, singnal
strength udah dapet, mobile network tipe : CDMA -1xRTT.

mohon bantuannya para master :(, stress nih

matur nuwon.

-- 
===============
"

3. GOT IT [ WTB: Motorola Droid 2 atau HTC Incredible atau EVO]

4. Problem cyanogen mod 6.1 pada htc evo

5. Changing price in the Market

6. How to enable SVG in WebKit?

7. Test case throws permission exception