我们想获取拍照图片的具体信息 安卓api是提供了的
方法如下
ExifInterface exifInterface = null; String dateString = null; try { exifInterface = new ExifInterface(IntentKey.FILE_PATH + s); String tagDateTime = exifInterface.getAttribute(ExifInterface.TAG_DATETIME); Log.e("----------------","-----------tagDateTime----"+tagDateTime); if (tagDateTime != null){ String tagDateTime1 = tagDateTime.replaceAll(":",""); //去除冒号 String tagDateTime2 = tagDateTime1.replaceAll(" ",""); //去除空格 String tagDateTime3 = tagDateTime1.replaceAll("_",""); //去除空格 dateString = tagDateTime3.substring(0,8); } } catch (IOException e) { e.printStackTrace(); }