public void refreshCategoryInfo() { // clear for (FileCategory fc : sCategories) { setCategoryInfo(fc, 0, 0); } // query database String volumeName = "external"; Uri uri = Audio.Media.getContentUri(volumeName); refreshMediaCategory(FileCategory.Music, uri); uri = Video.Media.getContentUri(volumeName); refreshMediaCategory(FileCategory.Video, uri); uri = Images.Media.getContentUri(volumeName); refreshMediaCategory(FileCategory.Picture, uri); uri = Files.getContentUri(volumeName); refreshMediaCategory(FileCategory.Theme, uri); refreshMediaCategory(FileCategory.Doc, uri); refreshMediaCategory(FileCategory.Zip, uri); refreshMediaCategory(FileCategory.Apk, uri); }
private Uri getContentUriByCategory(FileCategory cat) { Uri uri; String volumeName = "external"; switch (cat) { case Theme: case Doc: case Zip: case Apk: uri = Files.getContentUri(volumeName); break; case Music: uri = Audio.Media.getContentUri(volumeName); break; case Video: uri = Video.Media.getContentUri(volumeName); break; case Picture: uri = Images.Media.getContentUri(volumeName); break; default: uri = null; } return uri; }