Search
 
SCRIPT & CODE EXAMPLE
 

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");
Comment

pass list to intent in android java

Intent intent = new Intent(getApplicationContext(),YourActivity.class);
Bundle bundle = new Bundle();
bundle.putParcelable("data", sharedBookingObject);
intent.putExtras(bundle);
startActivity(intent);
Comment

PREVIOUS NEXT
Code Example
Java :: java argument main 
Java :: java output array lists to file 
Java :: java delete directory with files 
Java :: datetimeformatter for java 
Java :: putting scanner into an array 
Java :: check if string contains only letters java 
Java :: java isolate the numbers from string 
Java :: java go troght loop object 
Java :: initialize hashset with values java 9 
Java :: declare hashmap java 
Java :: java replace all not number 
Java :: spigot kill entity 
Java :: view get text android 
Java :: java list contains object with property 
Java :: java remove trailing zeros from float 
Java :: how to send a byte array in socket java 
Java :: how to summon lightning in minecraft 
Java :: how to generate random id in java 
Java :: java mp3 player 
Java :: how to iterate pixels image java 
Java :: java return tuple 
Java :: UTC in Java 
Java :: implementing iterator for linked list java 
Java :: android get distance between two locations kotlin 
Java :: java secretkey 
Java :: how to print something in java 
Java :: Instant class java 
Java :: java get number out of string 
Java :: List into string java 
Java :: java get relative path 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =