这是我的问题...我想分享一个 png 图像。我有可绘制和资产中的图像。当我使用sharingIntent 时,它可以工作,但不是我想要的方式。共享的文件显示为带有数字且没有扩展名,并且某些应用程序会发送消息“未知文件”。我能做些什么??
这是我的代码:
Uri uri = Uri.parse("android.resource://com.example.shareimages/" + R.drawable.caja);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("image/png");
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(shareIntent, "send"));
我尝试使用资产中的文件而不是可绘制文件(使用此“ file:///android_asset/...),但它没有用