File file = new File(path);
if (!file.exists()) {
file.mkdirs();
}
if (file.exists()) {
String[] titles = FileUtils.getImageNames(path);
if (titles != null && titles.length > 0) {
Log.e("T", ""
+ Environment.getExternalStorageDirectory().getPath());
//某个图片的路径,然后再根据路径获取Bitmap并显示出来BitmapFactory.decodeFile(pathName)
String[] imagePaths = new String[titles.length];
for (int i = 0; i < titles.length; i++) {
imagePaths[i] = Config.APP_PATH_CACHE_IMG + "rectPhoto/"
+ titles[i];
}
PictureAdapter adapter = new PictureAdapter(titles, imagePaths,
this);
gridView.setAdapter(adapter);
} else {
}
}else
{
}
获取sd卡某路径下的图片,并展示出来
最新推荐文章于 2023-07-18 21:00:00 发布