Methods Summary |
---|
public static Uri.Builder | appendId(Uri.Builder builder, long id)Appends the given ID to the end of the path.
return builder.appendEncodedPath(String.valueOf(id));
|
public static long | parseId(android.net.Uri contentUri)Converts the last path segment to a long.
This supports a common convention for content URIs where an ID is
stored in the last segment.
String last = contentUri.getLastPathSegment();
return last == null ? -1 : Long.parseLong(last);
|
public static android.net.Uri | withAppendedId(android.net.Uri contentUri, long id)Appends the given ID to the end of the path.
return appendId(contentUri.buildUpon(), id).build();
|