Having a problem with the managedQuery below,

I am trying to get the value of the CallLogs.Calls.TYPE or in other
words the type of the call, missed, answered, dialled.

however I keep getting this error 12-17 15:17:50.580: WARN/System.err
(1488): android.database.CursorIndexOutOfBoundsException: Index -1
requested, with a size of 1

Cant quite make out what it means myself, calls.count shows that it
does find the one record for the callRowId, so why is it saying Index
-1 requested?


String [] requestedColumns = {
                        CallLog.Calls.TYPE

            };

                try{
            Cursor calls = managedQuery(
                        CallLog.Calls.CONTENT_URI, requestedColumns,
                                CallLog.Calls._ID + "=?", new String[]
{callRowId},null);



                int callTypeIndex = calls.getColumnIndex(CallLog.Calls.TYPE);
                int callType = calls.getInt(callTypeIndex);

                }catch(RuntimeException e){

                        e.printStackTrace();
                }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to