problem in deleting Call Log

by shahzad ahmad » Wed, 18 Feb 2009 21:39:13 GMT


Sponsored Links
 Hi,

I can easily delete the whole call log with following code



getContentResolver().delete(CallLog.Calls.CONTENT_URI,null,null);



I can query a particular call log with following code

            delUri = Uri.withAppendedPath(CallLog.Calls.CONTENT_URI, "2");

            Cursor cursor =
getContentResolver().query(delUri,null,null,null,null);

But i always get unsupported function error when i try to delete a single
call log

            getContentResolver().delete(delUri,null,null);


Please guide me how to resolve this issue .

thanks,
shahzad

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



problem in deleting Call Log

by Chandra Mouli » Wed, 18 Feb 2009 21:49:43 GMT


 Try cursor.deleteRow() on the cursor you got from query.







-- 
G . chandra mouli

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


Sponsored Links


problem in deleting Call Log

by shahzad ahmad » Wed, 18 Feb 2009 23:14:04 GMT


 I'm using SDK 1.0 r2 . This fucntion cursor.deleteRow is deprecated in
latest SDK






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



problem in deleting Call Log

by david liu » Thu, 19 Feb 2009 01:35:31 GMT


 There are three paremeters for delete(delUri,null,null),  I think the first
one is about the table which you want to operate, the second is Where
clause, here you need put the selecting condition (such as, rowId = 2), the
third one we can use null.
You also can refer to the instruction of this method in the package
"android.database.sqlite.SQLiteDatabase".

On Wed, Feb 18, 2009 at 11:13 PM, shahzad ahmad






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



problem in deleting Call Log

by Gulfam » Fri, 06 Mar 2009 19:40:01 GMT


 Hi,

  I am facing the same problem for deleting perticullar call log
any one can help me i have tried as david liu said but not able to
delete

Regards,
Gulfam






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



Other Threads

1. BaseAdapter getView question

I have a question about getView method of BaseAdapter that I overwrote
to populate my GridView. All is well when convertView parameter is
null - I create my views for cells and populate them, works and looks
great.
The problem is when my data is updated and notifyDataSetChanged(); is
called somewhere else in my app convertView parameters in getView are
all screwed up.
Here is an example. I created Button view for position 0 and the rest
TextViews. When I get getView calls with convertView not null for
position 0 it's not a Button that I created but a TextView - WTF? For
now I just ignore convertView parameter and always create new views
but clearly either I don't understand something here or it's a bug. I
hope it's me.
--~--~---------~--~----~------------~-------~--~----~

2. Best Practices for Image Buttons?

My goal is to have a method for creating buttons in that I can use
custom backgrounds (one for normal and one for highlighted/selected
state) and use the normal text drawing on top of it.

Just setting the background on a regular Button works except for no
highlighting.  ImageButton can't draw text.

Does this require a custom class?  If so, would it be better to extend
Button or ImageButton?  I really want all the regular button
functionality with focus and selection but just using my 2 background
images.

Also - if anyone has done this, can I get a little code snippet?  I'd
like to avoid reinventing the wheel.

Thanks!
--~--~---------~--~----~------------~-------~--~----~

3. Simple GridView question

4. Unable to emulate Hello, Android

5. setSelector listview Text bug?

6. Understanding onCreate() and orientation change

7. ContentObserver - SMS - What's wrong with it