Java Code Examples for android.provider.MediaStore.Audio.Genres#_ID

The following examples show how to use android.provider.MediaStore.Audio.Genres#_ID . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenreLoader.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
private static Cursor makeGenreCursor(@NonNull final Context context) {
    final String[] projection = new String[]{
            Genres._ID,
            Genres.NAME
    };

    try {
        return context.getContentResolver().query(
                Genres.EXTERNAL_CONTENT_URI,
                projection, null, null, PreferenceUtil.getInstance(context).getGenreSortOrder());
    } catch (SecurityException e) {
        return null;
    }
}
 
Example 2
Source File: GenreLoader.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
private static Cursor makeGenreCursor(@NonNull final Context context) {
    final String[] projection = new String[]{
            Genres._ID,
            Genres.NAME
    };

    try {
        return context.getContentResolver().query(
                Genres.EXTERNAL_CONTENT_URI,
                projection, null, null, PreferenceUtil.getInstance(context).getGenreSortOrder());
    } catch (SecurityException e) {
        return null;
    }
}
 
Example 3
Source File: GenreLoader.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public static Cursor getGenreCursorForArtist(final  Context context, long artistId) {
    String query = " _id in (select genre_id from audio_genres_map where audio_id in (select _id from audio_meta where "+SongLoader.BASE_SELECTION+" AND artist_id = "+artistId+"))" ;
    final String[] projection = new String[]{
            Genres._ID,
            Genres.NAME
    };
    try {
        return context.getContentResolver().query(
                Genres.EXTERNAL_CONTENT_URI,
                projection, query, null, SortOrder.GenreSortOrder.GENRE_A_Z/*PreferenceUtil.getInstance(context).getGenreSortOrder()*/);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example 4
Source File: GenreLoader.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
private static Cursor makeGenreCursor(@NonNull final Context context) {
    final String[] projection = new String[]{
            Genres._ID,
            Genres.NAME
    };

    try {
        return context.getContentResolver().query(
                Genres.EXTERNAL_CONTENT_URI,
                projection, null, null, PreferenceUtil.getInstance().getGenreSortOrder());
    } catch (SecurityException e) {
        return null;
    }
}
 
Example 5
Source File: GenreLoader.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
private static Cursor makeGenreCursor(@NonNull final Context context) {
    final String[] projection = new String[]{
            Genres._ID,
            Genres.NAME
    };

    try {
        return context.getContentResolver().query(
                Genres.EXTERNAL_CONTENT_URI,
                projection, null, null, PreferenceUtil.getInstance(context).getGenreSortOrder());
    } catch (SecurityException e) {
        return null;
    }
}