在android中我无法以jpeg和png格式共享图片。请帮忙纠正我的代码在Android中分享图片的错误
每当我的共享代码它给
这是我的代码例外“不支持的文件格式”:
Uri imageUri = Uri.parse("android.resource://com.parekh.shareimage/drawable");
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, "My sample image text");
shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
shareIntent.setType("image/*");
startActivity(shareIntent);
该代码指向一个目录 – Chisko
除此之外,相对较少的应用程序处理'android.resource'方案好。而且,并非每个应用都会处理*'EXTRA_TEXT' *和*'EXTRA_STREAM'。 – CommonsWare
请更正我的代码 – Parekh