Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

pass list to intent in android java

First, make the class of the list implement Serializable.

public class Object implements Serializable{}
Then you can just cast the list to (Serializable). Like so:

List<Object> list = new ArrayList<Object>();
myIntent.putExtra("LIST", (Serializable) list);
And to retrieve the list you do:

Intent i = getIntent();
list = (List<Object>) i.getSerializableExtra("LIST");
 
PREVIOUS NEXT
Tagged: #pass #list #intent #android #java
ADD COMMENT
Topic
Name
4+5 =