2016-08-11 22 views
1

我做了代码共享图像,所以我使用默认共享代码按照below.it在所有device.it工作正常,但我不能分享在棉花糖OS设备的应用程序。如何在棉花糖中使用默认分享共享?

代码:

Uri imageuri = Uri.fromFile(imageFile); 
    Intent send_report = new Intent(Intent.ACTION_SEND); 
    send_report.putExtra(Intent.EXTRA_EMAIL, new String[]{PrefexamList.getString(App.PEMAIL, "")}); 
    send_report.putExtra(Intent.EXTRA_SUBJECT, "Your Result"); 
    send_report.putExtra(Intent.EXTRA_STREAM, imageuri); 
    send_report.putExtra(Intent.EXTRA_TEXT, "Here attached Your result."); 
    send_report.setType("text/plain"); 
    send_report.setType("image/png"); 
    startActivityForResult(Intent.createChooser(send_report, "Choose an Email client"), 77); 

你的回答将不胜感激

回答

0

这可能是由于运行时间许可。 Android棉花糖需要运行时间权限才能访问存储在设备中的图像文件。所以你需要在代码中给予运行时权限。请访问

https://developer.android.com/training/permissions/requesting.html

+0

我没有到storage.can相关的所有运行时permition你建议我该permition已经失踪了? – Vasant

+0

你的targetSdkVersion是什么? –

+0

targetSdkVersion = 23 – Vasant