Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The first part....</p> <pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND_MULTIPLE); sendIntent.setType("plain/text"); sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"abc@gmail.com"}); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Accident Capture"); sendIntent.putExtra(Intent.EXTRA_TEXT, emailBody); ArrayList&lt;Uri&gt; uriList = getUriListForImages(); sendIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uriList); Log.d(TAG, "Size of the ArrayList :: " +uriList.size()); FormHolderActivity.this.startActivity(Intent.createChooser(sendIntent, "Email:")); </code></pre> <p>------------------GetUriListForImages--------------------------------</p> <pre><code>private ArrayList&lt;Uri&gt; getUriListForImages() throws Exception { ArrayList&lt;Uri&gt; myList = new ArrayList&lt;Uri&gt;(); String imageDirectoryPath = Environment.getExternalStorageDirectory().getAbsolutePath()+ "/folder/"; File imageDirectory = new File(imageDirectoryPath); String[] fileList = imageDirectory.list(); if(fileList.length != 0) { for(int i=0; i&lt;fileList.length; i++) { try { ContentValues values = new ContentValues(7); values.put(Images.Media.TITLE, fileList[i]); values.put(Images.Media.DISPLAY_NAME, fileList[i]); values.put(Images.Media.DATE_TAKEN, new Date().getTime()); values.put(Images.Media.MIME_TYPE, "image/jpeg"); values.put(Images.ImageColumns.BUCKET_ID, imageDirectoryPath.hashCode()); values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileList[i]); values.put("_data", imageDirectoryPath + fileList[i]); ContentResolver contentResolver = getApplicationContext().getContentResolver(); Uri uri = contentResolver.insert(Images.Media.EXTERNAL_CONTENT_URI, values); myList.add(uri); } catch (Exception e) { e.printStackTrace(); } } } return myList; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload