【问题标题】:how to require user give an image filepath? [closed]如何要求用户提供图像文件路径? [关闭]
【发布时间】:2018-05-22 11:26:06
【问题描述】:

我是 Android 新手。

我正在尝试构建图像播放器。
我要求用户提供他们想要打开的图像。
但我不知道如何要求用户提供URL

请帮帮我....

【问题讨论】:

标签: android image-uploading


【解决方案1】:
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, REQUEST_CODE_LOAD_IMAGE);

【讨论】:

  • 虽然这段代码 sn-p 可以解决问题,但including an explanation 确实有助于提高帖子的质量。请记住,您是在为将来的读者回答问题,而这些人可能不知道您提出代码建议的原因。
  • 非常感谢,我知道了
猜你喜欢
  • 1970-01-01
  • 2022-12-06
  • 2021-12-15
  • 1970-01-01
  • 2017-06-02
  • 1970-01-01
  • 1970-01-01
  • 2020-09-13
  • 1970-01-01
相关资源
最近更新 更多