Parcelable传递对象
[url]http://www.apkbus.com/android-19356-1-1.html[/url]
Parcelable对象
[url]http://blog.163.com/eden_dahua/blog/static/18549828320114311210519/[/url]
[url]http://blog.sina.com.cn/s/blog_4cdc44df0100xofl.html[/url]
[url]http://hi.baidu.com/tyliang/blog/item/b42f2986e4128f36c75cc358.html[/url]
[url]http://www.apkbus.com/android-19356-1-1.html[/url]
Parcelable对象
import android.os.Parcel;
import android.os.Parcelable;
public class Person implements Parcelable
{
private String Name = "anupama";
private String Address = "India";
private int Age = 30;
@Override
public int describeContents()
{
// TODO Auto-generated method stub
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flag)
{
// TODO Auto-generated method stub
dest.writeString(Name);
dest.writeString(Address);
dest.writeInt(Age);
}
public Person(Parcel in)
{
this.Name = in.readString();
this.Address = in.readString();
this.Age = in.readInt();
}
@SuppressWarnings("unchecked")
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public Person createFromParcel(Parcel in)
{
return new Person(in);
}
public Person[] newArray(int size)
{
return new Person;
}
};
}
[url]http://blog.163.com/eden_dahua/blog/static/18549828320114311210519/[/url]
[url]http://blog.sina.com.cn/s/blog_4cdc44df0100xofl.html[/url]
[url]http://hi.baidu.com/tyliang/blog/item/b42f2986e4128f36c75cc358.html[/url]