Code example for Uri

Methods: buildUpon

0
            return CONTENT_URI_WITHSHOW.buildUpon().appendPath(episodeId).build();
        } 
    } 
 
    public static class Seasons implements SeasonsColumns, BaseColumns {
        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_SEASONS)
                .build();
 
        /** Use if multiple items get returned */ 
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.seriesguide.season";
 
        /** Use if a single item is returned */ 
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.seriesguide.season";
 
        public static Uri buildSeasonUri(String seasonId) {
            return CONTENT_URI.buildUpon().appendPath(seasonId).build();
        } 
 
        public static String getSeasonId(Uri uri) {
            return uri.getLastPathSegment();
        }