Build 1.0_r1(from source)

android.os
Interface Parcelable

All Known Implementing Classes:
AbsListView.SavedState, AbsSavedState, AbsSpinner.SavedState, ActivityInfo, ActivityManager.MemoryInfo, ActivityManager.ProcessErrorStateInfo, ActivityManager.RecentTaskInfo, ActivityManager.RunningServiceInfo, ActivityManager.RunningTaskInfo, Address, ApplicationInfo, Bitmap, Bundle, ColorStateList, ComponentName, CompoundButton.SavedState, Configuration, ContentValues, Criteria, CursorWindow, DhcpInfo, ExpandableListConnector.GroupMetadata, ExpandableListView.SavedState, IActivityManager.ContentProviderHolder, InstrumentationInfo, Intent, Intent.ShortcutIconResource, IntentFilter, KeyEvent, ListView.SavedState, Location, Message, Messenger, MotionEvent, NetworkInfo, Notification, PackageInfo, PackageParser.ActivityIntentInfo, PackageParser.IntentInfo, PackageParser.ServiceIntentInfo, PackageStats, ParcelFileDescriptor, PatternMatcher, PendingIntent, PermissionGroupInfo, PermissionInfo, Preference.BaseSavedState, ProviderInfo, Rect, Region, RemoteViews, ResolveInfo, ResultInfo, ScanResult, SearchableInfo, SearchableInfo.ActionKeyInfo, ServiceInfo, ServiceState, Signature, SupplicantState, Surface, SyncResult, SyncStats, TempProviderSyncAdapter.SyncData, TextView.SavedState, Uri, View.BaseSavedState, WifiConfiguration, WifiInfo, WindowManager.LayoutParams

public interface Parcelable

Interface for classes whose instances can be written to and restored from a Parcel. Classes implementing the Parcelable interface must also have a static field called CREATOR, which is an object implementing the Parcelable.Creator interface.

A typical implementation of Parcelable is:

 public class MyParcelable implements Parcelable {
     private int mData;
     
     public void writeToParcel(Parcel out, int flags) {
         out.writeInt(mData);
     }

     public static final Parcelable.Creator CREATOR
             = new Parcelable.Creator() {
         public MyParcelable createFromParcel(Parcel in) {
             return new MyParcelable(in);
         }

         public MyParcelable[] newArray(int size) {
             return new MyParcelable[size];
         }
     }
     
     private MyParcelable(Parcel in) {
         mData = in.readInt();
     }
 }


Nested Class Summary
static interface Parcelable.Creator<T>
          Interface that must be implemented and provided as a public CREATOR field that generates instances of your Parcelable class from a Parcel.
 
Field Summary
static int CONTENTS_FILE_DESCRIPTOR
          Bit masks for use with describeContents(): each bit represents a kind of object considered to have potential special significance when marshalled.
static int PARCELABLE_WRITE_RETURN_VALUE
          Flag for use with writeToParcel(android.os.Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".
 
Method Summary
 int describeContents()
          Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 void writeToParcel(Parcel dest, int flags)
          Flatten this object in to a Parcel.
 

Field Detail

PARCELABLE_WRITE_RETURN_VALUE

static final int PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel(android.os.Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)". Some implementations may want to release resources at this point.

See Also:
Constant Field Values

CONTENTS_FILE_DESCRIPTOR

static final int CONTENTS_FILE_DESCRIPTOR
Bit masks for use with describeContents(): each bit represents a kind of object considered to have potential special significance when marshalled.

See Also:
Constant Field Values
Method Detail

describeContents

int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns:
a bitmask indicating the set of special object types marshalled by the Parcelable.

writeToParcel

void writeToParcel(Parcel dest,
                   int flags)
Flatten this object in to a Parcel.

Parameters:
dest - The Parcel in which the object should be written.
flags - Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature