好吧我终于把问题归结为这种方法。Java Uri.fromFile路径问题
我有称为文件File对象,当我做一个toString()它输出如下
/storage/emulated/0/Pictures/ecohelp/IMG_ecohelp_20131016_214242.jpg
现在后的文件对象被插入到以下方法
Uri uriFile = Uri.fromFile(file);
当我做了一个uriFile.toString()它输出以下内容
file:///storage/emulated/0/Pictures/ecohelp/IMG_ecohelp_20131016_214242.jpg
现在我试着删除/在“/ storage ...”的开头,但它仍然不起作用,任何人都知道为什么会发生这种情况?它应该是file://像其他任何东西一样,但是它放在其中三个。
我试图模仿这种对图片:http://developer.android.com/guide/topics/media/camera.html#saving-media
我在尝试保存文件时,这个错误:
10-16 22:16:39.945: E/AndroidRuntime(32080): java.lang.RuntimeException:
Failure delivering result ResultInfo{who=android:fragment:2, request=100,
result=-1, data=null} to activity
{com.example.ecohelp/com.example.ecohelp.MainActivity}: java.lang.NullPointerException