Build 1.0_r1(from source)

android.content
Class ContentUris

java.lang.Object
  extended by android.content.ContentUris

public class ContentUris
extends Object

Utility methods useful for working with content Uris, those with a "content" scheme.


Constructor Summary
ContentUris()
           
 
Method Summary
static Uri.Builder appendId(Uri.Builder builder, long id)
          Appends the given ID to the end of the path.
static long parseId(Uri contentUri)
          Converts the last path segment to a long.
static Uri withAppendedId(Uri contentUri, long id)
          Appends the given ID to the end of the path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentUris

public ContentUris()
Method Detail

parseId

public static long parseId(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.

Returns:
the long conversion of the last segment or -1 if the path is empty
Throws:
UnsupportedOperationException - if this isn't a hierarchical URI
NumberFormatException - if the last segment isn't a number

appendId

public static Uri.Builder appendId(Uri.Builder builder,
                                   long id)
Appends the given ID to the end of the path.

Parameters:
builder - to append the ID to
id - to append
Returns:
the given builder

withAppendedId

public static Uri withAppendedId(Uri contentUri,
                                 long id)
Appends the given ID to the end of the path.

Parameters:
contentUri - to start with
id - to append
Returns:
a new URI with the given ID appended to the end of the path

Build 1.0_r1(from source)

Please submit a feedback, bug or feature