@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initView(); downloadImg();//這里有一個下載線程 String key = hasKeyForDisk(imageUrl); try { DiskLruCache.Snapshot snapShot = diskLruCache.get(key); if (snapShot != null) { InputStream is = snapShot.getInputStream(0); Bitmap bitmap = BitmapFactory.decodeStream(is); imageView.setImageBitmap(bitmap); } } catch (IOException e) { e.printStackTrace(); } }downloadImg();下載一個大圖片,我想問問,下面的邏輯會不會等這個線程下載完才執(zhí)行呢?如果不會,那下面的邏輯需要下載的文件,怎么處理?現(xiàn)在的問題是能下載文件,但是imageView.setImageBitmap(bitmap);不能顯示圖片....
添加回答
舉報(bào)
0/150
提交
取消