当前位置: 代码迷 >> Android >> android 中取得照片的名称
  详细解决方案

android 中取得照片的名称

热度:102   发布时间:2016-04-28 04:16:14.0
android 中获得照片的名称
从相册中选择一张照片在imageView中显示,可是怎么获得照片的名称,我用这个
String picturePath = cursor.getString(columnIndex);
cursor.close();
imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
textViewnm.setText("名称" +picturePath);显示的是照片的路径和名称,,,怎么才能只显示名称
------解决方案--------------------
File ff = new File(picturePath);
String filename =  ff.getName();
  相关解决方案