Multiple Photo not sending to gmail using Intent

后端 未结 3 494
时光说笑
时光说笑 2020-12-12 07:47

I am new to android and trying to send the multiple files to gmail using the Intent. But its not sending the attached files. Please help me for this.

Below is the my

3条回答
  •  青春惊慌失措
    2020-12-12 08:21

    UPDATE

    try with full path like this

    uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/foldername/certi/qualifications.jpg")));
    

    use this

    Intent share = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); 
    

    instead of

    Intent share = new Intent(android.content.Intent.ACTION_SEND);
    

    try this

     Intent ei = new Intent(Intent.ACTION_SEND_MULTIPLE);
                ei.setType("plain/text");
                ei.putExtra(Intent.EXTRA_EMAIL, new String[] {"email id"});
                ei.putExtra(Intent.EXTRA_SUBJECT, "That one works");
    
                ArrayList fileList = new ArrayList();
                fileList.add(Environment.getExternalStorageDirectory()+"/foldername/certi/qualifications.jpg");
                fileList.add(Environment.getExternalStorageDirectory()+"/foldername/certi/certificate.jpg");
                fileList.add(Environment.getExternalStorageDirectory()+"/foldername/Aa.pdf");
    
                ArrayList uris = new ArrayList();
                //convert from paths to Android friendly Parcelable Uri's
    
                for (int i=0;i

提交回复
热议问题