A blog for technology, SEO tips, website development and open source programming.

Send list of file between Activities on Android

0 88

Android

How do I pass data between activities in Android?

To send list of file via intent, in sender activity:

ArrayList fileList = new ArrayList();
...
Intent intent = new Intent(MainActivity.this, secondActivity.class);
intent.putExtra("FILES_TO_SEND", fileList);
startActivity(intent);

In receiver activity:
ArrayList filelist =
(ArrayList)getIntent().getSerializableExtra("FILES_TO_SEND");

Leave a Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More