我不知道为什么createtempfile()
失败,我已经设置了读写权限。
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="john.god.com.whereitssnap">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
xxx.class
//storageDir = /storage/emulated/0/Pictures
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(imageFileName,".jpg", storageDir);
//logcat show nothing, it's empty
Log.i("image ",""+image );