【问题标题】:Android sharing the activity image using a buttonAndroid 使用按钮共享活动图像
【发布时间】:2012-07-28 10:32:57
【问题描述】:

我希望在用户点击按钮时分享用户制作的图片

该图像是他使用绘画等许多功能制作的图像。 当他单击共享按钮时,我想要一个共享意图“共享方式”。 出现并让他选择他想要分享的地方

我找到了这段代码,但我从(路径)得到一个错误

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse(path);
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));

我该怎么做?

【问题讨论】:

  • 我听说图片必须先保存,所以我如何将“currentBitmap”的图像保存然后分享到他选择的地方..

标签: android image button imageview share


【解决方案1】:

你在变量路径中放了什么?

路径是指向您之前保存位图的文件的路径(SD 卡或内部应用程序存储)。

图片一定要先保存是对的,但是如果现在不保存,路径变量怎么填呢?

【讨论】:

猜你喜欢
  • 2012-06-23
  • 1970-01-01
  • 2020-07-21
  • 1970-01-01
  • 2013-02-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多