2016-05-23 5 views
0

Versucht mit unten Code und seine gehende Bild, aber nicht Text über Messaging und es funktioniert gut mit E-Mail, WhatsApp. jeder kann mir empfehlen, wie esBild und Text gehen nicht auf einmal durch Android Messaging

Uri shareImageUri = saveBitmapImage(result); 
       final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 

       emailIntent.putExtra(Intent.EXTRA_STREAM, shareImageUri); 
       emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Hiiiiiiiiiiiiiiiiiiiiiiii"); 
       emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"byeeeeeeeeeeee"); 

       emailIntent.setType("image/png"); 
       mActivity.startActivity(Intent.createChooser(emailIntent, "Send mail...")); 

Antwort

0

tun, um diesen Code Versuchen:

String fileName = "image_file_name.jpg";//Name of an image 
String externalStorageDirectory = Environment.getExternalStorageDirectory().toString(); 
String myDir = externalStorageDirectory + "/saved_images/"; // the file will be in saved_images 
Uri uri = Uri.parse("file:///" + myDir + fileName); 
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); 
shareIntent.setType("text/html"); 
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test Mail"); 
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Launcher"); 
shareIntent.putExtra(Intent.EXTRA_STREAM, uri); 
startActivity(Intent.createChooser(shareIntent, "Share Image and Text")); 

oder

File filePath = getFileStreamPath("share_image.jpg"); //optional //internal storage 
    Intent shareIntent = new Intent(); 
    shareIntent.setAction(Intent.ACTION_SEND); 
    shareIntent.putExtra(Intent.EXTRA_TEXT, "share content"); 
    shareIntent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(new File(filePath))); //optional//use this when you want to send an image 
    shareIntent.setType("image/jpeg"); 
    shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 
    startActivity(Intent.createChooser(shareIntent, "share")); 
+0

seine nicht funktioniert und Text nicht angezeigt – srinu