android.provider.MediaStore.Audio.PlaylistsColumns Java Examples

The following examples show how to use android.provider.MediaStore.Audio.PlaylistsColumns. 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: PlaylistLoader.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
public static Playlist getPlaylist(@NonNull final Context context, final String playlistName) {
    return getPlaylist(makePlaylistCursor(
            context,
            PlaylistsColumns.NAME + "=?",
            new String[]{
                    playlistName
            }
    ));
}
 
Example #2
Source File: PlaylistLoader.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
public static Cursor makePlaylistCursor(@NonNull final Context context, final String selection, final String[] values) {
    try {
        return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
                new String[]{
                    /* 0 */
                        BaseColumns._ID,
                    /* 1 */
                        PlaylistsColumns.NAME
                }, selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example #3
Source File: PlaylistLoader.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
public static Playlist getPlaylist(@NonNull final Context context, final String playlistName) {
    return getPlaylist(makePlaylistCursor(
            context,
            PlaylistsColumns.NAME + "=?",
            new String[]{
                    playlistName
            }
    ));
}
 
Example #4
Source File: PlaylistLoader.java    From MusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
public static Cursor makePlaylistCursor(@NonNull final Context context, final String selection, final String[] values) {
    try {
        return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
                new String[]{
                    /* 0 */
                        BaseColumns._ID,
                    /* 1 */
                        PlaylistsColumns.NAME
                }, selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example #5
Source File: PlaylistLoader.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
public static Playlist getPlaylist(@NonNull final Context context, final String playlistName) {
    return getPlaylist(makePlaylistCursor(
            context,
            PlaylistsColumns.NAME + "=?",
            new String[]{
                    playlistName
            }
    ));
}
 
Example #6
Source File: PlaylistLoader.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
public static Cursor makePlaylistCursor(@NonNull final Context context, final String selection, final String[] values) {
    try {
        return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
                new String[]{
                    /* 0 */
                        BaseColumns._ID,
                    /* 1 */
                        PlaylistsColumns.NAME
                }, selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example #7
Source File: PlaylistLoader.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
public static Cursor makePlaylistCursor(@NonNull final Context context, final String selection, final String[] values) {
    try {
        return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
                new String[]{
                    /* 0 */
                        BaseColumns._ID,
                    /* 1 */
                        PlaylistsColumns.NAME
                }, selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example #8
Source File: PlaylistLoader.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
public static Observable<Playlist> getPlaylist(@NonNull final Context context, final String playlistName) {
    return getPlaylist(makePlaylistCursor(
            context,
            PlaylistsColumns.NAME + "=?",
            new String[]{
                    playlistName
            }
    ));
}
 
Example #9
Source File: PlaylistLoader.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
public static Playlist getPlaylist(@NonNull final Context context, final String playlistName) {
    return getPlaylist(makePlaylistCursor(
            context,
            PlaylistsColumns.NAME + "=?",
            new String[]{
                    playlistName
            }
    ));
}
 
Example #10
Source File: PlaylistLoader.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
public static Cursor makePlaylistCursor(@NonNull final Context context, final String selection, final String[] values) {
    try {
        return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
                new String[]{
                    /* 0 */
                        BaseColumns._ID,
                    /* 1 */
                        PlaylistsColumns.NAME
                }, selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example #11
Source File: PlaylistLoader.java    From Muzesto with GNU General Public License v3.0 5 votes vote down vote up
public static final Cursor makePlaylistCursor(final Context context) {
    return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
            new String[]{
                    BaseColumns._ID,
                    PlaylistsColumns.NAME
            }, null, null, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
}
 
Example #12
Source File: PlaylistsFragment.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
public void setupFragmentData(){
    mAdapter = new PlaylistAdapter(getActivity(), R.layout.music_listview_items, null,
            										new String[] {}, new int[] {}, 0);
	mProjection = new String[] {
            BaseColumns._ID, PlaylistsColumns.NAME
    };
    mSortOrder = Audio.Playlists.DEFAULT_SORT_ORDER;
    mUri = Audio.Playlists.EXTERNAL_CONTENT_URI;
    mFragmentGroupId = 5;
    mType = TYPE_PLAYLIST;
    mTitleColumn = PlaylistsColumns.NAME;         
}
 
Example #13
Source File: PlaylistsFragment.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    AdapterContextMenuInfo mi = (AdapterContextMenuInfo)menuInfo;
    menu.add(mFragmentGroupId, PLAY_SELECTION, 0, getResources().getString(R.string.play_all));
    if (mi.id >= 0) {
        menu.add(mFragmentGroupId, RENAME_PLAYLIST, 0, getResources().getString(R.string.rename_playlist));
        menu.add(mFragmentGroupId, DELETE_PLAYLIST, 0, getResources().getString(R.string.delete_playlist));
    }
    mCurrentId = mCursor.getString(mCursor.getColumnIndexOrThrow(BaseColumns._ID));
    String title = mCursor.getString(mCursor.getColumnIndexOrThrow(PlaylistsColumns.NAME));
    menu.setHeaderTitle(title);
}
 
Example #14
Source File: PlaylistLoader.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
@NonNull
public static Playlist getPlaylist(@NonNull final Context context, final String playlistName) {
    return getPlaylist(makePlaylistCursor(
            context,
            PlaylistsColumns.NAME + "=?",
            new String[]{
                    playlistName
            }
    ));
}
 
Example #15
Source File: PlaylistLoader.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
@Nullable
public static Cursor makePlaylistCursor(@NonNull final Context context, final String selection, final String[] values) {
    try {
        return context.getContentResolver().query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
                new String[]{
                    /* 0 */
                        BaseColumns._ID,
                    /* 1 */
                        PlaylistsColumns.NAME
                }, selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);
    } catch (SecurityException e) {
        return null;
    }
}
 
Example #16
Source File: PlaylistAdapter.java    From mobile-manager-tool with MIT License 4 votes vote down vote up
public void setupViewData( Cursor mCursor ){
	mLineOneText = mCursor.getString(mCursor.getColumnIndexOrThrow(PlaylistsColumns.NAME));
}