0
Intent intent = new Intent(getActivity(), loadactivity.class);
intent.putExtra("Arraylist", imagearraylist);
startActivity(intent)
AskNilesh
  • 58,437
  • 15
  • 99
  • 129
Taps
  • 27
  • 6

3 Answers3

0

Hope this will help you! Paste the following code in your activity.

ArrayList<Object> imagearraylist = (ArrayList<Object>) getIntent().getSerializableExtra("Arraylist");

Reference: How to pass ArrayList<CustomeObject> from one activity to another?

Hay Trần
  • 536
  • 4
  • 20
0

Use Interface Like Mentioned In Link

Passing Data Between Fragments to Activity

Or You Can Simply Use Public static ArrayList<String> imagearraylist;

(Passing Huge Arraylist Through Intent May Leads To Crash)

0

For this, you have to use interface

    public interface arrayInterface {    
        public void onSetArray(ArrayList<T>);         
    }

Implement this interface in your activity

public class YrActivity extends Activity implements arrayInterface.OnFragmentInteractionListener {
       private ArrayList<T> allData;
    @override
    public void arrayInterface(ArrayList<T> data) {
      allData = data;
    }
    }

Then you have to send the data with listner

arrayInterface listener = (arrayInterface) activity;
listener.onSetArray(allData)

And its done