'parcelable'에 해당되는 글 1건

  1. 2014.12.06 Parcelable 객체 만들기
Android 안드로이드2014. 12. 6. 20:59










안드로이드와 개발툴과 

피씨와 함께 하는중



Bundle, 

Parcelable, 

Serializable 

객체가 필요해 만들었으나

사용처가 사라졌다.


차후에 쓸 곳이 있으리라.







public class MyParcelable extends SumClass implements Parcelable {


public MyParcelable(Plus mPlus) {

super(mPlus);

}


@Override

public int describeContents() {

return 0;

}


@Override

public void writeToParcel(Parcel dest, int flags) {

dest.writeValue(mPlus);

}


// public static final must be gone. Because this disappear is caused from Inner class... I guess.

public final Parcelable.Creator<MyParcelable> CREATOR = new Parcelable.Creator<MyParcelable>() {

public MyParcelable createFromParcel(Parcel in) {

Plus plus = (Plus) in.readValue(null);

return new MyParcelable(Plus);

}


public MyParcelable[] newArray(int size) {

return new MyParcelable[size];

}

};

}







Posted by 코드버무려