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();
}
我做错了什么!!