Android中的Mms显示“您无法将此图片添加到您的邮件中”

时间:2015-03-30 12:13:23

标签: android

MM中还有其他问题,但没有一个问题解决了我的问题,我根本就不知道为什么!!

String fileName = "/one.png";
                    File dataFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());
                    Toast.makeText(c, String.valueOf(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath()), Toast.LENGTH_LONG).show();

                     if(dataFile.exists())
                     {


                    Intent shareIntent = new Intent(Intent.ACTION_SEND);
                    shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
                    shareIntent.setType("image/*"); 


                    shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath()+fileName));
                    Intent new_intent = Intent.createChooser(shareIntent, "Share via");
                    new_intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
                    c.getApplicationContext().startActivity(new_intent);

                     }

                     else
                     {
                         Toast.makeText(c, "Not Found", Toast.LENGTH_LONG).show();

                     }

我做错了什么!!

0 个答案:

没有答案