Aug 30, 2013

Send list of file between activities

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

   ArrayList<File> fileList = new ArrayList<File>();
   ...

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


In receiver activity:

  ArrayList<File> filelist = 
      (ArrayList<File>)getIntent().getSerializableExtra("FILES_TO_SEND");


No comments:

Post a Comment

Infolinks In Text Ads