Code example for Uri

Methods: withAppendedPath

0
  public CursorLoader getPeopleCursor(Context context) {
    return getPeopleCursor(context, Phone.CONTENT_URI);
  } 
 
  public CursorLoader getPeopleCursor(Context context, String filter) {
    Uri uri = Uri.withAppendedPath(Phone.CONTENT_FILTER_URI, Uri.encode(filter));
    return getPeopleCursor(context, uri);
  } 
 
  private CursorLoader getPeopleCursor(Context context, Uri uri) {
    return new CursorLoader(context, uri, PEOPLE_PROJECTION,
                            PEOPLE_SELECTION, null, PEOPLE_ORDER);
  } 
 
  public CursorLoader getFavoritesCursor(Context context) {
    return getFavoritesCursor(context, Phone.CONTENT_URI);
  } 
 
  public CursorLoader getFavoritesCursor(Context context, String filter) {
    Uri uri = Uri.withAppendedPath(Phone.CONTENT_FILTER_URI, Uri.encode(filter));
    return getFavoritesCursor(context, uri);