给你一个案例看看他的导入哪里62616964757a686964616fe58685e5aeb931333365656538的
import android.os.Parcel;
import android.os.Parcelable;
public class ParcelableData implements Parcelable{
private String name;
private int age;
public ParcelableData(){
name = "guest";
age = 20;
}
public ParcelableData(Parcel in){
//顺序要和writeToParcel写的顺序一样
name = in.readString();
age = in.readInt();
}
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
public int getAge(){
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
// TODO Auto-generated method stub
dest.writeString(name);
dest.writeInt(age);
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public ParcelableData createFromParcel(Parcel in) {
return new ParcelableData(in);
}
public ParcelableData[] newArray(int size) {
return new ParcelableData[size];
}
};
}