Android File.length() 获取相册图片文件大小出错
宋玮-深圳 2014-10-28 05:01:53 举例: "/storage/sdcard0/DCIM/Camera/FrontCamera/IMG_20141015_234121.jpg"
相机拍照的,1.3M文件。用下面代码直接取,只能得到171KB
File srcfile = new File(path);
Log.d(TAG, "(KB):"+srcfile.length()/8/1024); //171KB return
把图片挪到电脑上看是1.3M, 或者挪到app自身的目录下再获取大小,都是1.3M没问题的。