Java tutorial
//package com.java2s; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import android.content.ContentUris; import android.net.Uri; public class Main { /** * Take an environment URI (one that identifies an environment) and produce an * event URI. * * That this is needed is tragic. * * @param environmentURI * the {@link Uri} returned by an environment operation. * @return a {@link Uri} to which insertions can be dispatched. */ public static Uri getEventURI(Uri environmentURI) { return environmentURI.buildUpon().path("/events/" + ContentUris.parseId(environmentURI) + "/").build(); } }