samedi 16 juillet 2016

YouTube's response array, sorting programatically

i'm creating an app where i get a youtube search. It is currently working ok, i just want to show better results, by sorting them by title name.

I got a VideoListResponse with 50 items

VideoListResponse videoListResponse = null;
    try {
        videoListResponse = mYouTubeDataApi.videos()
                .list(YOUTUBE_VIDEOS_PART)
                .setFields(YOUTUBE_VIDEOS_FIELDS)
                .setKey(ApiKey.YOUTUBE_API_KEY)
                .setId(TextUtils.join(",", videoIds)).execute();
    } catch (IOException e) {
        e.printStackTrace();
    }

and i want to sort them by title. Let me show an image of the item list:

sort by title

i'm pretty much stuck with this, thank you guys !

Aucun commentaire:

Enregistrer un commentaire