I want to brows the list images names from media provider, will
somebody guide me?


Will following work, I am trying on my basic knowledge
public class MImageLists extends ListActivity {
        private static final String TAG = "MImageLists";
        /**
     * The columns we are interested in from the database
     */
    private static final String[] PROJECTION = new String[] {
        Media._ID, // 0
        Media.DISPLAY_NAME, //1
    };

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Log.i(TAG, "Before setContentView");
        setContentView(R.layout.notes_list);
        Log.i(TAG, "After setContentView");

        Intent intent = getIntent();
        if (intent.getData() == null) {
            intent.setData(Thumbnails.INTERNAL_CONTENT_URI);
        }

        /*Cursor cursor = Media.query(getContentResolver(),
Media.INTERNAL_CONTENT_URI,
                        PROJECTION, null, null, Media.DEFAULT_SORT_ORDER);*/
        Log.i(TAG, "Cursor Successful retrieved");

        Cursor cursor = managedQuery(getIntent().getData(),
PROJECTION, null, null,
                        Media.DEFAULT_SORT_ORDER);
        //cursor.
     // Used to map notes entries from the database to views
        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.notes_row, cursor,
                new String[] { Media.DISPLAY_NAME }, new int[]
{ android.R.id.text1 });
        Log.i(TAG, "Before setListAdapter");
        setListAdapter(adapter);
    }
}
--~--~---------~--~----~------------~-------~--~----~
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