Why do I sometimes get a null return, from ContentResolver query?

by sandy8531 » Sun, 08 Mar 2009 09:56:01 GMT


Sponsored Links
 My external sdcard is connected, mounted and functional. I have over
1000 songs on the sdcard, however occasionally this query returns a
null Cursor to me.

Can someone shed some light as to why this happens ? Can I get this is
the underlying table is locked by another thread ? Should I take a
null return from the query to mean a temporary error ?

String[] cols = {
                Media._ID,
                Media.TITLE,
        };

Cursor c = context.getContentResolver().query
( Media.EXTERNAL_CONTENT_URI,
cols,
Media.IS_MUSIC + " = 1",
null,
null);

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



Other Threads

1. Two different views with CursorAdapter

I am not sure if you can do this, but essentially what I am trying to
do is to use a CursorAdapter with a list that has two different
views.  To be more specific, I am trying to have a different view for
an item in the list that's selected than the rest of the items in the
list that's not selected.  Is this possible?

If so how? some code snippet would help greatly.  thanks
--~--~---------~--~----~------------~-------~--~----~

2. Enabling route table with Custom Wifi driver

thanks for the information..Android is really doing great on my board..
-vinay

On Thu, Jan 15, 2009 at 10:54 PM, dimitr...@android.com <






--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Saving/Loading dynamic Bitmaps

4. Does Android need a more compelling/smoother user interface? (consumer view)

5. How do you get in touch with Google Android Staff?

6. "my downloads" in Android Market

7. No onTrackballEvent in ItemizedOverlay<OverlayItem>?