private void share() {
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/png");
share.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file://" + filename));
startActivity(Intent.createChooser(share, "Share Tag"));
}
Run Code Online (Sandbox Code Playgroud)
我实现了这个从菜单中调用的简单函数,但在我调用之后,我共享的文件完全消失了 - 好像共享正在从我的存储中删除它.为什么这样做,我该如何阻止?
尝试这样做:
Uri uri = Uri.fromFile(new File(filename));
share.putExtra(Intent.EXTRA_STREAM, uri);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3514 次 |
| 最近记录: |