javaandroidandroid-cursor

Android - how to delete item from a cursor?


Let's say I make the following cursor to get the call log of someone:

String[] strFields = {
    android.provider.CallLog.Calls.NUMBER, 
    android.provider.CallLog.Calls.TYPE,
    android.provider.CallLog.Calls.CACHED_NAME,
    android.provider.CallLog.Calls.CACHED_NUMBER_TYPE
    };

String strOrder = android.provider.CallLog.Calls.DATE + " DESC"; 

Cursor mCallCursor = getContentResolver().query(
        android.provider.CallLog.Calls.CONTENT_URI,
        strFields,
        null,
        null,
        strOrder
        );

Now how would I go about deleted the ith item in this cursor? This could also be a cursor getting list of music, etc. So then I must ask - is this even possible? I can understand for certain cursors that 3rd party apps wouldn't be allowed to delete from.

Thanks.


Solution

  • Sorry mate you can't delete from a cursor.

    You must either use your ContentResolver or a SQL call of some sort..