第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Android:使用Asynctask從Web加載圖像

Android:使用Asynctask從Web加載圖像

紫衣仙女 2019-08-19 15:00:07
Android:使用Asynctask從Web加載圖像如何用Asynctask替換以下代碼行?你如何從Asynctask“取回”位圖?謝謝。ImageView mChart = (ImageView) findViewById(R.id.Chart);String URL = "http://www...anything ...";mChart.setImageBitmap(download_Image(URL));public static Bitmap download_Image(String url) {         //---------------------------------------------------         Bitmap bm = null;         try {             URL aURL = new URL(url);             URLConnection conn = aURL.openConnection();             conn.connect();             InputStream is = conn.getInputStream();             BufferedInputStream bis = new BufferedInputStream(is);             bm = BitmapFactory.decodeStream(bis);             bis.close();             is.close();         } catch (IOException e) {             Log.e("Hub","Error getting the image from server : " + e.getMessage().toString());         }          return bm;         //---------------------------------------------------     }我想過這樣的事情:替換:mChart.setImageBitmap(download_Image(graph_URL));通過類似的東西:mChart.setImageBitmap(new DownloadImagesTask().execute(graph_URL));有一個(gè)簡單的解決方案嗎?我在這里弄錯(cuò)了嗎?
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 308 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)