How can I make this Serializable?

HoJunLee

I'm very sorry for i explained like fool...

I mean I can't compile because of error. enter image description here

enter image description here

public class PictureBean implements Serializable
{
public enum CCLtype implements Serializable
{
    BY, ND, CO, NN, SA
}

private String picture_rm;
private String picture_url;
private String picture_16_9_url;
private String author;
private String title;
private String description;
private String p_memo;
private String p_original_rate;
private String move_url;
private int like_count;
private int picture_exp_count;
private List<JsonObject> tagList;
private List<JsonObject> categoryList;
private CCLtype ccl;
private String picture_source;
private boolean isUserLiked;
private boolean isUserAdded;

I use this PictureBean.class for contain image datas in my server.

but when I send list of PictureBean data to activity from activity, like below, Eclipse occurred error line.

How could I send list of PictureBean to activity from activity?

'mItems''s dataType is List of PictureBean.

intent.putExtra(CategoryDetailPagerActivity.EXTRA_DATA_CATEGORY_DETAIL_LIST, mItems); 
hasan

Update:

Don't put the list it self as an extra. send a class object that contain the list as the only member as follow:

public class SerialObject implements Serializable
{
    private static final long serialVersionUID = -3975620301776205681L;

    public List<PictureBean> myItems;
}

SerialObject sb = new SerialObject();
sb.myItems = mItems;
intent.putExtra(CategoryDetailPagerActivity.EXTRA_DATA_CATEGORY_DETAIL_LIST, sb);    

Original Answer:

This is how your class should be:

public class PictureBean implements Serializable
{
    private static final long serialVersionUID = 6969933524911660214L;

    public enum CCLtype
    {
        BY, ND, CO, NN, SA
    }

    private String picture_rm;
    private String picture_url;
    private String picture_16_9_url;
    private String author;
    private String title;
    private String description;
    private String p_memo;
    private String p_original_rate;
    private String move_url;
    private int like_count;
    private int picture_exp_count;
    private List<JsonObject> tagList;
    private List<JsonObject> categoryList;
    private CCLtype ccl;
    private String picture_source;
    private boolean isUserLiked;
    private boolean isUserAdded;
}

Same thing for the JsonObject class.

I believe that you don't have to serialise CCLtype

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to make MERGE serializable

From Dev

How to make an XML Serializable?

From Java

How do I make JavaFX TreeView and TreeItem serializable?

From Dev

How do I make JavaFX TreeView and TreeItem serializable?

From Java

How to make a class JSON serializable

From Dev

How can I make this repeat?

From Dev

How can I make slope

From Dev

How can I make this recursive?

From Dev

How can I make this sophistictaed?

From Dev

How can i make animation?

From Dev

How can I make this sophistictaed?

From Dev

How can I make this repeat?

From Dev

How can i make this work

From Dev

Powershell - how can I make

From Dev

How can I store references of non-serializable objects in Java? (Android)

From Dev

Can we make Lucene IndexWriter serializable for ExecutionContext of Spring Batch?

From Dev

How can I make this code into a class so I can reuse it?

From Dev

In awk, how can I make a boolean value that I can toggle it?

From Dev

How can I make flush JButtons in swing?

From Dev

How can I make a transparent tabPage?

From Dev

How can I make a Self Containing Function?

From Dev

How can I make calendar view in Swift

From Dev

How can I make a UIRefreshControl smaller?

From Dev

How can I make this refers to the class in the function?

From Dev

How can I make Meteor subscriptions dynamic?

From Dev

How can I make a default parameter in Typescript?

From Dev

How can I make a CKQuery without predicate?

From Dev

How can I make this animation smoother?

From Dev

How can I make a slider with height of the webpage?