Android访问媒体数据库

ContentResolver resolver = mActivity.getAndroidContext().getContentResolver();

String[] cols = {"_id","_data"};

Cursor cursor=resolver.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cols, "_data='"+name+"'", null, "_display_name");

图片:MediaStore.Images.Media.EXTERNAL_CONTENT_URI

视频:Video.Media.EXTERNAL_CONTENT_URI

音乐:MediaStore.Audio.Media.EXTERNAL_CONTENT_URI

 

posted on 2012-11-27 10:35  Binarys  阅读(...)  评论(...编辑  收藏

导航

统计