Skip to content Skip to sidebar Skip to footer

Passing Entire Arraylist From One Activity To Other In Android

I want to pass a ArrayList from one activity to other. I have found this link for pass arraylist from one activity to other useful. But when I am using ArrayList

Solution 1:

There's lots of ways to do it, but have you tried:

myIntent.putStringArrayListExtra(key, hyperlinks);

Also, the Bundle object has

 putStringArrayList

Solution 2:

check into Application. You can extend your own application, and save the arraylist here

check out ==> Extending Application to share variables globally

Solution 3:

Bundle Documentation clearly indicating that putStringArrayList(String, ArrayList) is method of Bundle class, but not putStringArrayListExtra()

http://developer.android.com/reference/android/os/Bundle.html#putStringArrayList(java.lang.String, java.util.ArrayList)

Also, please Check import declarations, and check if Proper Bundle class has been imported or not.

Package of Bundle class should be:

import android.os.Bundle;

Post a Comment for "Passing Entire Arraylist From One Activity To Other In Android"