如何通过意图将可包裹对象的2D数组发送到另一个活动中?有帮助吗?
这是我的可包裹自定义对象:
ReplaySubject
我不像这样创建一个对象:
public class PTagData implements Parcelable {
public int mStartWordIndex;
public PTagData(int startWordIndex) {
this.mWordsPerRow = wordsPerRow;
}
protected PTagData(Parcel in) {
mStartWordIndex = in.readInt();
}
public static final Creator<PTagData> CREATOR = new Creator<PTagData>() {
@Override
public PTagData createFromParcel(Parcel in) {
return new PTagData(in);
}
@Override
public PTagData[] newArray(int size) {
return new PTagData[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mStartWordIndex);
}
}
如何将此类对象传递给其他活动?