Note that there are some explanatory texts on larger screens.

plurals
  1. PONot Serializable Exception on custom class - Android
    primarykey
    data
    text
    <p>So I'm trying to pass an instance of a class I create by intent to a new activity.</p> <pre><code>public class Room implements Serializable{ /** * */ private static final long serialVersionUID = 6857044522819206055L; int roomID; String roomName; ArrayList&lt;MarkerHolder&gt; markerHolders = new ArrayList&lt;MarkerHolder&gt;(); public int getRoomID() { return roomID; } public void setRoomID(int roomID) { this.roomID = roomID; } public String getRoomName() { return roomName; } public void setRoomName(String roomName) { this.roomName = roomName; } public ArrayList&lt;MarkerHolder&gt; getMarkerHolders() { return markerHolders; } public void setMarkerHolders(ArrayList&lt;MarkerHolder&gt; markerHolders) { this.markerHolders = markerHolders; } } public class MarkerHolder implements Serializable{ /** * */ private static final long serialVersionUID = -7334724625702415322L; String marker; String markerTag; public String getMarker() { return marker; } public void setMarker(String marker) { this.marker = marker; } public String getMarkerTag() { return markerTag; } public void setMarkerTag(String markerTag) { this.markerTag = markerTag; } } </code></pre> <p>And I try to pass that class by</p> <pre><code>Intent svc = new Intent(this, RoomUploader.class); svc.putExtra("room", room); try{ startService(svc); }catch (Exception e){ e.printStackTrace(); } </code></pre> <p>and I keep getting a Not Serializable Exception which I can't figure out. Both classes implement serializable and have serial Ids. The member variables are just strings, ints, and an array of another class that is also serializable that contains only strings. As far as I know all these things should be serializable, what else could cause this error? Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload