try{
for(int i=0; i < datalist.size(); i++){
URL url = new URL(datalist.get(i).getImagepath());
URLConnection conn = url.openConnection();
conn.connect();
int nSize = conn.getContentLength();
BufferedInputStream bis = new BufferedInputStream(conn.getInputStream(),nSize);
datalist.get(i).setImagebitmap(BitmapFactory.decodeStream(bis));
bis.close();
}
Message msg = mhandler.obtainMessage();
msg.obj = datalist;
mhandler.sendMessage(msg);
}catch (Exception e) {
// TODO: handle exception
Log.d("ErrorLog", "GetImageFromUrl : BitmapLoadError");
}
이렇게 이미지경로를 받아와서.. handler로 보내줍니다.
public ViewPagerAdapter(Context con){
super();
mInflater = LayoutInflater.from(con);
context = con;
ItemDataLoad data = new ItemDataLoad(handler);
data.start();
handler = new Handler(){
@Override
public void handleMessage(Message msg) {
// TODO Auto-generated method stub
super.handleMessage(msg);
if(true){
itemarray = (ArrayList<ItemInfoDto>) msg.obj;
}
Log.d("--", "length = " + msg.obj);
}
};
}
itemarray = (ArrayList<ItemInfoDto>) msg.obj;
이부분.. 안되네요 ..ㅠㅠ 다른방법아시는분 계신가요?