Answers for "pass model class in intent android"

1

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");
Posted by: Guest on February-07-2020
0

android pass object to activity

Intent intent = new Intent(fromClass.this,toClass.class).putExtra("myCustomerObj",customerObj);
Posted by: Guest on March-19-2020

Code answers related to "pass model class in intent android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language