불러오는속도가 너무느립니다..
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gallery_list);
// 파일정보넘기기위해 main에서 intent값 전달받음.
Intent intent = getIntent();
user_id = intent.getStringExtra("user_id");
user_no = intent.getStringExtra("user_no");
bo_table = intent.getStringExtra("bo_table");
progress = (ProgressBar) findViewById(R.id.web_progress);
mThumbImageInfoList = new ArrayList<GalleryItem>();
mGvImageList = (GridView) findViewById(R.id.gvImageList);
ListActivity = GalleryListMain.this;
//이미지 불러오는 함수
findThumbList();
updateUI();
//new DoFindImageList().execute();
}
private void updateUI() {
mListAdapter = new ImageAdapter(this, R.layout.gallery_cell,
mThumbImageInfoList);
mGvImageList.setAdapter(mListAdapter);
}
private long findThumbList() {
long returnValue = 0;
long returnValues = 0;
// Select 하고자 하는 컬럼
String[] projection2 = { MediaStore.Images.Thumbnails._ID,
MediaStore.Images.Thumbnails.DATA };
// 썸네일 이미지 불러
// 이미지편집으로 넘길 이미지쿼리F
Cursor imageCursor = managedQuery(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection2,
null, null, MediaStore.Images.Media.DATE_ADDED + " desc ");
if (imageCursor != null && imageCursor.getCount() > 0) {
// 컬럼 인덱스
int imageIDCol = imageCursor
.getColumnIndex(MediaStore.Images.Media._ID);
int imageDataCol = imageCursor
.getColumnIndex(MediaStore.Images.Thumbnails.DATA);
int imageDataCol2 = imageCursor
.getColumnIndex(MediaStore.Images.Media.DATA);
// 커서에서 이미지의 ID와 경로명을 가져와서 ThumbImageInfo 모델 클래스를 생성해서
// 리스트에 더해준다.
while (imageCursor.moveToNext()) {
GalleryItem thumbInfo = new GalleryItem();
thumbInfo.setId(imageCursor.getString(imageIDCol));
thumbInfo.setData(imageCursor.getString(imageDataCol));
thumbInfo.setData2(imageCursor.getString(imageDataCol));
//원본을 썸네일로바꿔서가져오는 함수만들어서사용
String path = getThumnailPath(getApplicationContext(),imageCursor.getString(imageDataCol));
thumbInfo.setPath(path);
BitmapFactory.Options option = new BitmapFactory.Options();
Bitmap bmp = BitmapFactory.decodeFile(path, option);
thumbInfo.setBitmap(bmp);
thumbInfo.setCheckedState(false);
mThumbImageInfoList.add(thumbInfo);
returnValue++;
}
}
// 이거 리쥼시 오류떠서주석처리해버림!
// imageCursor.close();
return returnValue;
}
glide와 원본의 썸네일로 불러와도 느립니다..
glide로 이미지 불러오는 부분추가입니다.
Glide.with(mContext).load(mArrData.get(position).getData())
.into(holder.ivImage);
카카오스토리나 다른앱의경우 바로뜨는데.. 저는 500장정도가 1분정도걸리는것같습니다