I have an Intent class to send multiple images to the email as an attached file. So all works fine. Only issue is that when no of images is more than 20 then it The Intent class takes time to open a particular mail client. So during that time i want to show progress bar to the user. So anyone help me to solve this out. My code for sending multiple images is shown below.
ArrayList<Uri> uris = new ArrayList<Uri>();
for(int i = 0; i< NoteManager.getSingletonObject().getNoteItemCount(); i++)
{
File imageFile = new File(m_ShareDir, NoteManager.getSingletonObject().getNote(i));
ContentValues values = new ContentValues(2);
values.put(MediaStore.Images.Media.MIME_TYPE, "image/png");
values.put(MediaStore.Images.Media.DATA, imageFile.getAbsolutePath());
Uri imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
uris.add(imageUri);
}
Intent intent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
intent.setType("image/png");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(Intent.createChooser(intent, getResources().getString(R.string.share_send_text)));
May it helps you