Android: Parcelable with inheritance - java

Now, I have three class, the base class is BaseWidget which implements Parcelable, two subclasses are SelectWidget and TextWidget. Then, I use a class named WidgetInfo (also implements Parcelable) to keep a list of BaseWidget or SelectWidget or TextWidget objects.
While I put WidgetInfo object into an Intent to start TestActivity, and I received WidgetInfo in TestActivity ,but all the elements of list (which in WidgetInfo) convert to BaseWidget object. And subclass object member variable is lost. What is problem???
BaseWidget.java:
public class BaseWidget implements Parcelable{
private String name;
public BaseWidget() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
protected BaseWidget(Parcel in) {
this.name = in.readString();
}
public static final Creator<BaseWidget> CREATOR = new Creator<BaseWidget>() {
#Override
public BaseWidget createFromParcel(Parcel in) {
return new BaseWidget(in);
}
#Override
public BaseWidget[] newArray(int size) {
return new BaseWidget[size];
}
};
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(name);
}
}
TextWidget.java:
public class TextWidget extends BaseWidget{
private String width = "100";
public TextWidget() {
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
protected TextWidget(Parcel in) {
super(in);
width = in.readString();
}
#Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(width);
}
#Override
public int describeContents() {
return 0;
}
public static final Creator<TextWidget> CREATOR = new Creator<TextWidget>() {
#Override
public TextWidget createFromParcel(Parcel in) {
return new TextWidget(in);
}
#Override
public TextWidget[] newArray(int size) {
return new TextWidget[size];
}
};
}
SelectWidget.java:
public class SelectWidget extends BaseWidget{
private int height = 200;
public SelectWidget() {
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
protected SelectWidget(Parcel in) {
super(in);
height = in.readInt();
}
#Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(height);
}
#Override
public int describeContents() {
return 0;
}
public static final Creator<SelectWidget> CREATOR = new Creator<SelectWidget>() {
#Override
public SelectWidget createFromParcel(Parcel in) {
return new SelectWidget(in);
}
#Override
public SelectWidget[] newArray(int size) {
return new SelectWidget[size];
}
};
}
WidgetInfo.java:
public class WidgetInfo implements Parcelable{
private List<BaseWidget> widgetList;
public WidgetInfo() {
}
public List<BaseWidget> getWidgetList() {
return widgetList;
}
public void setWidgetList(List<BaseWidget> widgetList) {
this.widgetList = widgetList;
}
protected WidgetInfo(Parcel in) {
widgetList = in.createTypedArrayList(BaseWidget.CREATOR);
}
public static final Creator<WidgetInfo> CREATOR = new Creator<WidgetInfo>() {
#Override
public WidgetInfo createFromParcel(Parcel in) {
return new WidgetInfo(in);
}
#Override
public WidgetInfo[] newArray(int size) {
return new WidgetInfo[size];
}
};
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeTypedList(widgetList);
}
}
start Intent:
WidgetInfo info = new WidgetInfo();
BaseWidget widget1 = new BaseWidget();
BaseWidget widget2 = new TextWidget();
BaseWidget widget3 = new SelectWidget();
List<BaseWidget> list = new ArrayList<>();
list.add(widget1);
list.add(widget2);
list.add(widget3);
info.setWidgetList(list);
Intent intent = new Intent(this, TestActivity.class);
intent.putExtra("widgetInfo", info);
startActivity(intent);

Related

how to send arraylist to another activity through parcable

I have a model class which implement Parcelable and 2 string and one arraylist of another model class
i can retrive title1 and title2 but i am not able to retrive option4 arraylist its get null
`public class TopListSubListModel implements Parcelable {
String title1,title2;
ArrayList option4;
public TopListSubListModel(String title1, String title2, ArrayList<Option4Model> option4) {
this.title1 = title1;
this.title2 = title2;
this.option4 = option4;
}
protected TopListSubListModel(Parcel in) {
title1 = in.readString();
title2 = in.readString();
}
public static final Creator<TopListSubListModel> CREATOR = new Creator<TopListSubListModel>() {
#Override
public TopListSubListModel createFromParcel(Parcel in) {
return new TopListSubListModel(in);
}
#Override
public TopListSubListModel[] newArray(int size) {
return new TopListSubListModel[size];
}
};
public String getTitle1() {
return title1;
}
public void setTitle1(String title1) {
this.title1 = title1;
}
public String getTitle2() {
return title2;
}
public void setTitle2(String title2) {
this.title2 = title2;
}
public ArrayList<Option4Model> getOption4() {
return option4;
}
public void setOption4(ArrayList<Option4Model> option4) {
this.option4 = option4;
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(title1);
parcel.writeString(title2);
}
}`

Adding Arraylist to custom object not updating values in android

In the below android activity, trying to display data in a view pager and it is working as expected.
But in loadItemsForSuppliers method, when i am adding SupplierAndItemList object to it's arraylist, value returned from getInventoriesByItemDetails method is not updating properly rather takes last value always.
Can some body assist me what's wrong here ?
public class ScreenSlidePagerActivity extends BaseActivity {
private ViewPager mPager;
private PagerAdapter mPagerAdapter;
private Dealer dealerObject;
private ArrayList<ItemDetail> itemDetails;
private List<Dealer> supplierList;
private ArrayList<SupplierAndItemList> supplierAndItemLists = new ArrayList<>();
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_screen_slide);
dealerObject = getIntent().getParcelableExtra(UiConstants.DEALER_OBJECT);
itemDetails = getIntent().getParcelableArrayListExtra("itemDetails");
supplierList = dealerObject.getParentSalesPoints(this,dealerObject.getServerId());
loadItemsForSuppliers();
mPager = (ViewPager) findViewById(R.id.pager);
mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager(),supplierAndItemLists);
mPager.setAdapter(mPagerAdapter);
}
private void loadItemsForSuppliers() {
for (Dealer dealer : supplierList) {
ArrayList<ItemDetail> inventories = new ArrayList<>();
SupplierAndItemList supplierAndItem = new SupplierAndItemList();
supplierAndItem.setDealerName(dealer.getDealerName());
supplierAndItem.setSelectedItemList(getInventoriesByItemDetails(dealer, inventories));
supplierAndItemLists.add(supplierAndItem);
}
}
private ArrayList<ItemDetail> getInventoriesByItemDetails(Dealer dealer, ArrayList<ItemDetail> inventories) {
for (ItemDetail id : itemDetails) {
DealerInventory dealerInventory = new DealerInventory();
dealerInventory = dealerInventory.getLastModifiedInventory(this, id.getItemId(), dealer.getId());
if (dealerInventory != null) {
if (dealerInventory.getQuantity() >= 0) {
id.setParentSalesPointLastStock(String.valueOf(dealerInventory.getQuantity()));
id.setParentSalesPointLastStockTakingDate(dealerInventory.getStockTakingDate());
}
} else {
id.setParentSalesPointLastStock(UiConstants.NA);
id.setParentSalesPointLastStockTakingDate(UiConstants.NA);
}
inventories.add(id);
}
return inventories;
}
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
private final ArrayList<SupplierAndItemList> supplierAndItemList;
public ScreenSlidePagerAdapter(FragmentManager fm, ArrayList<SupplierAndItemList> supplierAndItemList) {
super(fm);
this.supplierAndItemList = supplierAndItemList;
}
#Override
public Fragment getItem(int position) {
SupplierAndItemList supplierAndItems = supplierAndItemList.get(position);
ScreenSlidePageFragment f = new ScreenSlidePageFragment();
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("supplierAndItems",supplierAndItems.getSelectedItemList());
bundle.putString("supplierName",supplierAndItems.getDealerName());
f.setArguments(bundle);
return f;
}
#Override
public int getCount() {
return supplierAndItemList.size();
}
}
}
SupplierAndItemList class
public class SupplierAndItemList implements Parcelable {
public String dealerName;
public ArrayList<ItemDetail> selectedItemList;
public SupplierAndItemList() {
selectedItemList = new ArrayList<>();
}
public String getDealerName() {
return dealerName;
}
public void setDealerName(String dealerName) {
this.dealerName = dealerName;
}
public ArrayList<ItemDetail> getSelectedItemList() {
return selectedItemList;
}
public void setSelectedItemList(ArrayList<ItemDetail> itemList) {
this.selectedItemList = itemList;
}
protected SupplierAndItemList(Parcel in) {
dealerName = in.readString();
selectedItemList = in.readArrayList(ItemDetail.class.getClassLoader());
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(dealerName);
dest.writeList(selectedItemList);
}
#SuppressWarnings("unused")
public static final Parcelable.Creator<SupplierAndItemList> CREATOR = new Parcelable.Creator<SupplierAndItemList>() {
#Override
public SupplierAndItemList createFromParcel(Parcel in) {
return new SupplierAndItemList(in);
}
#Override
public SupplierAndItemList[] newArray(int size) {
return new SupplierAndItemList[size];
}
};
}
ItemDetail class
public class ItemDetail implements Parcelable {
public int itemId;
public String itemName;
public String salesPointLastStock;
public String salesPointLastStockTakingDate;
public String parentSalesPointLastStock;
public String parentSalesPointLastStockTakingDate;
public IDStockInput idStockInput;
public IDReturnInput idReturnInput;
public IDOrderInput idOrderInput;
public boolean isSelected;
public boolean isSelected() {
return isSelected;
}
public void setIsSelected(boolean isUpdated) {
this.isSelected = isUpdated;
}
public String getParentSalesPointLastStockTakingDate() {
return parentSalesPointLastStockTakingDate;
}
public void setParentSalesPointLastStockTakingDate(String parentSalesPointLastStockTakingDate) {
this.parentSalesPointLastStockTakingDate = parentSalesPointLastStockTakingDate;
}
public String getParentSalesPointLastStock() {
return parentSalesPointLastStock;
}
public void setParentSalesPointLastStock(String parentSalesPointLastStock) {
this.parentSalesPointLastStock = parentSalesPointLastStock;
}
#NonNull
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
#NonNull
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
#NonNull
public String getSalesPointLastStock() {
return salesPointLastStock;
}
public void setSalesPointLastStock(String salesPointLastStock) {
this.salesPointLastStock = salesPointLastStock;
}
#NonNull
public String getSalesPointLastStockTakingDate() {
return salesPointLastStockTakingDate;
}
public void setSalesPointLastStockTakingDate(String salesPointLastStockTakingDate) {
this.salesPointLastStockTakingDate = salesPointLastStockTakingDate;
}
public IDStockInput getIdStockInput() {
return idStockInput;
}
public void setIdStockInput(IDStockInput idStockInput) {
this.idStockInput = idStockInput;
}
public IDReturnInput getIdReturnInput() {
return idReturnInput;
}
public void setIdReturnInput(IDReturnInput idReturnInput) {
this.idReturnInput = idReturnInput;
}
public IDOrderInput getIdOrderInput() {
return idOrderInput;
}
public void setIdOrderInput(IDOrderInput idOrderInput) {
this.idOrderInput = idOrderInput;
}
public ItemDetail() {
idStockInput = new IDStockInput();
idReturnInput = new IDReturnInput();
idOrderInput = new IDOrderInput();
}
protected ItemDetail(Parcel in) {
itemId = in.readInt();
itemName = in.readString();
salesPointLastStock = in.readString();
salesPointLastStockTakingDate = in.readString();
parentSalesPointLastStock = in.readString();
parentSalesPointLastStockTakingDate = in.readString();
isSelected =in.readInt()==1;
idStockInput = (IDStockInput) in.readValue(IDStockInput.class.getClassLoader());
idReturnInput = (IDReturnInput) in.readValue(IDReturnInput.class.getClassLoader());
idOrderInput = (IDOrderInput) in.readValue(IDOrderInput.class.getClassLoader());
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(itemId);
dest.writeString(itemName);
dest.writeString(salesPointLastStock);
dest.writeString(salesPointLastStockTakingDate);
dest.writeString(parentSalesPointLastStock);
dest.writeString(parentSalesPointLastStockTakingDate);
dest.writeInt(isSelected ? 1 : 0);
dest.writeValue(idStockInput);
dest.writeValue(idReturnInput);
dest.writeValue(idOrderInput);
}
#SuppressWarnings("unused")
public static final Parcelable.Creator<ItemDetail> CREATOR = new Parcelable.Creator<ItemDetail>() {
#Override
public ItemDetail createFromParcel(Parcel in) {
return new ItemDetail(in);
}
#Override
public ItemDetail[] newArray(int size) {
return new ItemDetail[size];
}
};
}
I have go through your method I have found some assigning value issue
private void loadItemsForSuppliers() {
for (Dealer dealer : supplierList) {
ArrayList<ItemDetail> inventories = new ArrayList<>();
SupplierAndItemList supplierAndItem = new SupplierAndItemList();
supplierAndItem.setDealerName(dealer.getDealerName());
supplierAndItem.setSelectedItemList(getInventoriesByItemDetails(dealer, inventories));
supplierAndItemLists.add(supplierAndItem);
}
}
private ArrayList<ItemDetail> getInventoriesByItemDetails(Dealer dealer, ArrayList<ItemDetail> inventories) {
for (ItemDetail id : itemDetails) {
DealerInventory dealerInventory = new DealerInventory();
dealerInventory = dealerInventory.getLastModifiedInventory(this, id.getItemId(), dealer.getId());
if (dealerInventory != null) {
if (dealerInventory.getQuantity() >= 0) {
id.setParentSalesPointLastStock(String.valueOf(dealerInventory.getQuantity()));
id.setParentSalesPointLastStockTakingDate(dealerInventory.getStockTakingDate());
}
} else {
id.setParentSalesPointLastStock(UiConstants.NA);
id.setParentSalesPointLastStockTakingDate(UiConstants.NA);
}
inventories.add(id); // do this
}
return inventories; // you are not assigning value anywhere;
}
You are not assigning value to the inventories in getInventoriesByItemDetails. I think you should add item through inventories.add(id);
Check it , Hope this help
Set
mPager.setOffscreenPageLimit(1);

How to sort ArrayList while implementing Parcelable

I am trying to sort the category arraylist with Collections.sort method but have no luck with it.
Here is my code:
public class Categories implements Parcelable {
private ArrayList<Category> category;
private Recent recent;
public ArrayList<Category> getCategories() {
return this.category;
}
public void setCategory(ArrayList<Category> category) {
this.category = category;
}
public Recent getRecent() {
return this.recent;
}
public void setRecent(Recent recent) {
this.recent = recent;
}
protected Categories(Parcel in) {
if (in.readByte() == 0x01) {
category = new ArrayList<Category>();
in.readList(category, Category.class.getClassLoader());
} else {
category = null;
}
recent = (Recent) in.readValue(Recent.class.getClassLoader());
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel dest, int flags) {
if (category == null) {
dest.writeByte((byte) (0x00));
} else {
dest.writeByte((byte) (0x01));
dest.writeList(category);
}
dest.writeValue(recent);
}
public static final Parcelable.Creator<Categories> CREATOR = new Parcelable.Creator<Categories>() {
#Override
public Categories createFromParcel(Parcel in) {
return new Categories(in);
}
#Override
public Categories[] newArray(int size) {
return new Categories[size];
}
};
}
You can also use custom comparator:
public class CategoriesComparator implements Comparator<Category> {
#Override
public int compare(Category category1, Category category2) {
return category1.getSomeProperty().compareTo(category2.getSomeProperty());
}
}
When you want to compare call this:
Collections.sort(yourListCategories, new CategoriesComparator());
Hope it helps!
Collections.sort(yourListHere,new Comparator<Categories>() {
#Override
public int compare(Categories lhs, Categories rhs) {
//your sort logic here
return 0;
}
});
Hope this helps.

NullPointerException when I try to read a Vector passed through Intent

I'm trying to use Parcelable classes to give a Stack from an activity to another. In order to do this I defined MyStack and MyVector3 in the following way. This is then included in a Model class.
Model class
public class Model implements Parcelable{
public List<MyStack> surfaces;
public Info info;
public Model (){}
public Model(List<MyStack> surf){
surfaces = surf;
}
public void setInfo(Info i){
info=i;
}
public Info getInfo(){
return info;
}
public List<MyStack> getSurfaces(){
return this.surfaces;
}
public int numSurfaces(){
return surfaces.size();
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel out, int flags) {
out.writeTypedList(surfaces);
//Parcelable infoP = ((Parcelable) info);
//out.writeParcelable(infoP, 0);
}
public static final Parcelable.Creator<Model> CREATOR
= new Parcelable.Creator<Model>() {
public Model createFromParcel(Parcel in) {
return new Model(in);
}
public Model[] newArray(int size) {
return new Model[size];
}
};
private Model(Parcel in) {
surfaces = new ArrayList<MyStack>();
in.readTypedList(surfaces, MyStack.CREATOR);
//info = in.readParcelable(Info.class.getClassLoader());
}
public class Info{
String title;
String descr;
public Info(String t, String d){
title=t;
descr=d;
}
public Info(String t){
title=t;
}
public void setDescr(String d){
descr=d;
}
}
}
MyStack class
public class MyStack implements Parcelable {
public Stack<MyVector3> stack;
public MyStack(MyStack ms){
this.stack=ms.stack;
}
public MyStack(Stack s){
stack= s;
}
public Stack getStack(){
return this.stack;
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel out, int flags) {
out.writeTypedList(stack);
}
public static final Parcelable.Creator<MyStack> CREATOR
= new Parcelable.Creator<MyStack>() {
public MyStack createFromParcel(Parcel in) {
return new MyStack(in);
}
public MyStack[] newArray(int size) {
return new MyStack[size];
}
};
private MyStack(Parcel in) {
stack= new Stack<MyVector3>();
in.readTypedList(stack, MyVector3.CREATOR);
}
}
MyVector3 class
public class MyVector3 extends Vector3 implements Parcelable {
public Vector3 vector;
public MyVector3(Vector3 v){
vector=v;
}
public MyVector3(double x, double y, double z){
vector= new Vector3(x,y,z);
}
public Vector3 getVector(){
return this.vector;
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel out, int flags) {
out.writeDoubleArray(new double[]{
this.x,
this.y,
this.z});
}
public static final Parcelable.Creator<MyVector3> CREATOR
= new Parcelable.Creator<MyVector3>() {
public MyVector3 createFromParcel(Parcel in) {
return new MyVector3(in);
}
public MyVector3[] newArray(int size) {
return new MyVector3[size];
}
};
private MyVector3(Parcel in) {
double[] data = new double[3];
in.readDoubleArray(data);
this.x= data[0];
this.y= data[1];
this.z= data[2];
}
}
This is the intent creation, where the model is well populated and I get all values correctly from Logs
Model model= new Model(surfaces);
Intent intent = new Intent(this, EditorPresenter.class);
intent.putExtra("model", model);
startActivity(intent);
And where I use it
Intent intent = getIntent();
model= intent.getParcelableExtra("model");
MyStack[] sf = model.surfaces.toArray(new MyStack[model.numSurfaces()]);
//surf = new Stack();
surf = new Stack[model.numSurfaces()];
Log.i(TAG, "ss="+Integer.toString(sf.length)); //expected value
for(int s=0; s<sf.length; s++) {
Log.i(TAG, "s="+Integer.toString(s)); //expected value
Stack st= new Stack();
Log.i(TAG, "vv="+Integer.toString(sf[s].getStack().size())); //expected value
for(int v=0; v<sf[s].getStack().size(); v++) {
Log.i(TAG, "v="+Integer.toString(v) +sf[s].stack.elementAt(v).getVector().toString()); //NullPointerException
MyVector3 mv = (MyVector3) sf[s].stack.elementAt(v);
if(mv!=null) st.add(mv.getVector());
}
surf[s]=st;
}
But I get a NullPointerException anytime I try to read/write a Vector3 value.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.rajawali3d.math.vector.Vector3.toString()' on a null object reference
The problem is probably in Parcelable classes, til I get a wrong model back from the intent (number of faces and vertices expected are right, vector values are probably null). Any help is really appreciated.
you are not instantiating your Vector object, after reading from parcelable. Change
private MyVector3(Parcel in) {
double[] data = new double[3];
in.readDoubleArray(data);
this.x= data[0];
this.y= data[1];
this.z= data[2];
}
with
private MyVector3(Parcel in) {
double[] data = new double[3];
in.readDoubleArray(data);
this.x= data[0];
this.y= data[1];
this.z= data[2];
vector = new Vector3(x,y,z);
}
You can generate Parcelable classes from your code using this tool http://www.parcelabler.com/ and try again with new generated classes.

Android - MyParceableClassInner[] inside MyParceableClassOuter

I'm trying to pass a custom parceable class which contains an array of another custom parceable class between activities. I tried to follow the advice here, but it didn't work for me.
This is the inner class, it works fine when passed alone:
import android.os.Parcel;
import android.os.Parcelable;
public class EntryImage implements Parcelable {
public int imageId;
public int entryid_id;
public String url;
public int height;
public EntryImage(int imageId, int entryid_id, String url, int height) {
this.imageId = imageId;
this.entryid_id = entryid_id;
this.url = url;
this.height = height;
}
public EntryImage(Parcel in) {
readFromParcel(in);
}
#Override
public int describeContents() {
return 0;
}
#Override
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(imageId);
parcel.writeInt(entryid_id);
parcel.writeString(url);
parcel.writeInt(height);
}
private void readFromParcel(Parcel in) {
imageId = in.readInt();
entryid_id = in.readInt();
url = in.readString();
height = in.readInt();
}
public static final Parcelable.Creator<EntryImage> CREATOR = new Parcelable.Creator<EntryImage>() {
public EntryImage createFromParcel(Parcel in) {
return new EntryImage(in);
}
public EntryImage[] newArray(int size) {
return new EntryImage[size];
}
};
}
And this is the outer class. The problem is in the last few lines of readFrom and writeToParcel:
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;
public class Entry implements Parcelable {
public int entryId;
public String name;
public EntryImage[] images;
public Entry(int entryId, String name, EntryImage[] images) {
this.entryId = entryId;
this.name = name;
this.images = images;
}
public Entry(Parcel in) {
readFromParcel(in);
}
public EntryImage getEntryImage (int asdf) {
return images[asdf];
}
#Override
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(entryId);
parcel.writeString(name);
parcel.writeParcelableArray(images, flags);
}
private void readFromParcel(Parcel in) {
entryId = in.readInt();
name = in.readString();
//images = in.readTypedArray(EntryImage[].class.getClassLoader());
Parcelable[] parcelableArray = in.readParcelableArray(EntryImage.class.getClassLoader());
EntryImage[] images = null;
if (parcelableArray != null) {
images = Arrays.copyOf(parcelableArray, parcelableArray.length, EntryImage[].class);
}
}
public static final Parcelable.Creator<Entry> CREATOR = new Parcelable.Creator<Entry>() {
public Entry createFromParcel(Parcel in) {
return new Entry(in);
}
public Entry[] newArray(int size) {
return new Entry[size];
}
};
}
The line in Entry.readFromParcel
EntryImage[] images = null;
should instead be
images = null;

Categories