在我的应用程序中,我正在尝试与ShareActionProvider共享骨形态发生蛋白。它不起作用。是我做错了还是我需要将它转换成PNG (我不想处理文件)。如果是这样,我该怎么做呢?谢谢。
Bitmap bmp = qrUtil.create(WIFIQRCODE, pref2);
isCodeGenerated = true;
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_STREAM, bmp);
provider.setShareIntent(intent);发布于 2013-11-13 07:06:32
Intent.EXTRA_STREAM应该是一个指向您想要使用的图像文件的URI;您不能只在那里添加一个Bitmap。你应该这样做:
Uri uri = Uri.fromFile(new File(getFilesDir(), "img.jpg"));
shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString());这将根据您的图像的实际位置而变化,但这是一般的想法。
https://stackoverflow.com/questions/19941458
复制相似问题