FileDocCategorySizeDatePackage
ContentProviderResult.javaAPI DocAndroid 5.1 API2758Thu Mar 12 22:22:10 GMT 2015android.content

ContentProviderResult

public class ContentProviderResult extends Object implements android.os.Parcelable
Contains the result of the application of a {@link ContentProviderOperation}. It is guaranteed to have exactly one of {@link #uri} or {@link #count} set.

Fields Summary
public final android.net.Uri
uri
public final Integer
count
public static final Creator
CREATOR
Constructors Summary
public ContentProviderResult(android.net.Uri uri)

        if (uri == null) throw new IllegalArgumentException("uri must not be null");
        this.uri = uri;
        this.count = null;
    
public ContentProviderResult(int count)

        this.count = count;
        this.uri = null;
    
public ContentProviderResult(android.os.Parcel source)

        int type = source.readInt();
        if (type == 1) {
            count = source.readInt();
            uri = null;
        } else {
            count = null;
            uri = Uri.CREATOR.createFromParcel(source);
        }
    
public ContentProviderResult(ContentProviderResult cpr, int userId)

hide

        uri = ContentProvider.maybeAddUserId(cpr.uri, userId);
        count = cpr.count;
    
Methods Summary
public intdescribeContents()

        return 0;
    
public java.lang.StringtoString()


       
        if (uri != null) {
            return "ContentProviderResult(uri=" + uri.toString() + ")";
        }
        return "ContentProviderResult(count=" + count + ")";
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        if (uri == null) {
            dest.writeInt(1);
            dest.writeInt(count);
        } else {
            dest.writeInt(2);
            uri.writeToParcel(dest, 0);
        }