如何让相机意图把照片变成内部存储? [英] How to have the Camera Intent put a photo into internal storage?

查看:185
本文介绍了如何让相机意图把照片变成内部存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在这个整天,似乎无法得到它的工作。它使用根据谁在它的工作的previous人之前的工作。

I have been at this all day and can't seem to get it to work. It use to work before according to the previous person who worked on it.

    cameraIntent = new Intent("android.media.action.IMAGE_CAPTURE");
        String imageName = CustomApp.getTimeStamp(0) ;
        String path = CustomApp.getCurrentActivity().getDir("images", Context.MODE_WORLD_WRITEABLE).getPath()+File.separator+imageName;

        File file = new File(path) ;
        Uri img = Uri.fromFile(file) ;

        Intent passthruDataIntent = new Intent();

        cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, img);
        CustomApp.getCurrentActivity().startActivityForResult(cameraIntent, CustomConstants.REQUESTCODE_CAMERA);

类似code已被张贴在这里,但它似乎并没有在4.2.2上我的Nexus 4的工作。我试图外部存储和正常工作即可。为什么它可能无法正常工作的任何有识之士将是非常有益的。谢谢你。

Similar code has been posted on here, but it doesn't seem to work on my nexus 4 on 4.2.2. I tried external storage and it works fine then. Any insight on why it might not be working would be very helpful. Thanks.

推荐答案

内部存储是私有的每个应用程序 - 第三方相机应用无权写信给你的内部存储

Internal storage is private for each app -- the third-party camera app has no rights to write to your internal storage.

这篇关于如何让相机意图把照片变成内部存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆