【问题标题】:Android-Camera intent isn't locate photo in specific folderAndroid-Camera Intent 未在特定文件夹中找到照片
【发布时间】:2013-03-20 09:57:33
【问题描述】:

我的 android 应用程序有小问题。我的应用程序通过调用标准的 android 相机意图来拍照:

Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, this.myURI);

startActivityForResult(cameraIntent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

应用程序从相机意图返回后,我尝试在存储它的目录中查找照片(通过代码),但照片不存在。那里的照片只是当我关闭我的应用程序并再次打开它时

我虽然可能文件夹被我锁定,所以相机意图无法将新照片放在那里。

请帮忙??

(我不知道是否有人问过这个问题(不知道要寻找什么),如果有,请告诉我)

【问题讨论】:

  • 发布异常的堆栈跟踪。
  • 没有例外,照片就是没有出现:(

标签: android android-intent android-camera


【解决方案1】:

你回来后试试把这条线

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));

这行做一次“刷新”,在手机识别出手机中保存的新闻照片后。

【讨论】:

    猜你喜欢
    • 2017-06-14
    • 2013-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-02
    • 2014-05-30
    相关资源
    最近更新 更多