我有一个图像浏览及分享按钮活动分享位图, 图像从DB如何保存和android中
检索我想保存在第一图像,然后分享它
每一个事情是怎么回事罚款,图像保存在内部存储器,它会分享,但当其他应用程序运行(如WhatsApp或消息)它说,文件不支持
我已推动其他图像ddms手动,然后共享工作没有任何问题!吴
我认为这个问题是从节约位图,甚至我检查从DDMS保存的位图,它是看起来不错
有我的代码:
保存
try {
FileOutputStream out = new FileOutputStream(new File(getFilesDir(), "temp.png"));
imageview.setImageBitmap(b1);
b1.compress(Bitmap.CompressFormat.PNG, 100, out);
out.flush();
out.close();
}
catch (Exception e) {}
分享方法
private void initShareIntent(String type,String _text)
{
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(new File(getFilesDir(), "temp.png")));
shareIntent.setType("image/PNG");
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(shareIntent, "send"));
}
你是如何获得的位图? –