2
어떻게 한 폴더에있는 모든 이미지를 안드로이드리스트 뷰에 동적으로로드 할 수 있습니까?한 폴더에있는 모든 이미지를 안드로이드리스트 뷰에 동적으로로드하는 방법 ..?
어떻게 한 폴더에있는 모든 이미지를 안드로이드리스트 뷰에 동적으로로드 할 수 있습니까?한 폴더에있는 모든 이미지를 안드로이드리스트 뷰에 동적으로로드하는 방법 ..?
첫 번째 다음 코드를 사용하여 특정 이미지의 모든 이미지를 검색하십시오.
두 번째 이미지를로드하는 데 LazyList 개념을 사용합니다. Lazy load of images in ListView
특정 폴더에서 모든 iamges을받는 방법
public void searchSDCardForImage() {
String path = null;
String uri = MediaStore.Images.Media.DATA;
String condition = uri + " like '%/GetImageFromThisDirectory/%'";
String[] projection = { uri, MediaStore.Images.Media.DATE_ADDED,
MediaStore.Images.Media.SIZE };
Vector additionalFiles = null;
try {
if (additionalFiles == null) {
additionalFiles = new Vector<String>();
}
Cursor cursor = managedQuery(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection,
condition, null, null);
if (cursor != null) {
boolean isDataPresent = cursor.moveToFirst();
if (isDataPresent) {
do {
path = cursor.getString(cursor.getColumnIndex(uri));
System.out.println("...path..."+path);
additionalFiles.add(path);
}while(cursor.moveToNext());
}
if (cursor != null) {
cursor.close();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
은에서 참조하시기 바랍니다 : [안드로이드 - 내가있는 ListView에서 이미지의 게으른로드해야합니까 방법] [1] [1] : http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 –
나는 referrin이다. g이 링크 https://github.com/thest1/LazyList/blob/master/src/com/fedorvlasov/lazylist/ImageLoader.java, 그들은 이미지 물마루 웹을 읽었지 만 특정 폴더 또는 res에서 읽으 려합니다./드로어 블 – user1065490