tt-rss-android/src/org/fox/ttrss/types/FeedCategoryList.java

53 lines
1.2 KiB
Java
Raw Normal View History

2012-06-19 14:32:18 +00:00
package org.fox.ttrss.types;
2011-11-28 14:45:32 +00:00
import java.util.ArrayList;
2012-06-19 10:18:00 +00:00
2011-11-28 14:45:32 +00:00
import android.os.Parcel;
import android.os.Parcelable;
@SuppressWarnings("serial")
public class FeedCategoryList extends ArrayList<FeedCategory> implements Parcelable {
public FeedCategoryList() { }
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(this.size());
for (FeedCategory feed : this) {
out.writeParcelable(feed, flags);
}
}
public void readFromParcel(Parcel in) {
int length = in.readInt();
for (int i = 0; i < length; i++) {
FeedCategory feed = in.readParcelable(FeedCategory.class.getClassLoader());
2011-11-28 14:45:32 +00:00
this.add(feed);
}
}
public FeedCategoryList(Parcel in) {
readFromParcel(in);
}
@SuppressWarnings("rawtypes")
public static final Parcelable.Creator CREATOR =
new Parcelable.Creator() {
public FeedCategoryList createFromParcel(Parcel in) {
return new FeedCategoryList(in);
}
public FeedCategoryList[] newArray(int size) {
return new FeedCategoryList[size];
}
};
}