-4
A
回答
0
可能是重複的,如前面提到的,不過,我會使用的AsyncTask從一個URL加載圖像(這似乎並不在提供的鏈接中就是這種情況)。沿着這些線路
東西:
new AsyncTask<String, Void, Drawable>() {
@Override
protected Drawable doInBackground(String... params) {
Drawable result = null;
try {
URL url = new URL(params[0]);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.connect();
InputStream input = connection.getInputStream();
result = Drawable.createFromStream(input, "src");
} catch (MalformedURLException muExp) {
Log.e(TAG, "Bad URL provided!", muExp);
} catch (IOException ioExp) {
Log.e(TAG, "Error loading content from URL!", ioExp);
}
return result;
}
@Override
protected void onPostExecute(Drawable result) {
// Do something with your Drawable, in UI, here...
}
}.execute("http://myimageurl.com/image.jpg");
相關問題
- 1. 在Android應用程序中顯示來自URL的圖像?
- 2. 來自URL中的圖像不會在Android中顯示原始應用程序
- 3. 如何在Android中顯示來自Url的圖像?
- 4. Android - 如何在ListView中顯示來自URL的圖像?
- 5. 如何在imagebutton中顯示來自URL的圖像 - xamarin Android
- 6. 如何在圖像視圖中顯示來自url的圖像?
- 7. 來自URL的Android顯示圖像
- 8. 如何顯示來自url的圖像
- 9. 如何顯示來自url的圖像
- 10. 在winRT應用程序中顯示來自web的圖像
- 11. 小應用程序不顯示來自Tomcat中的URL的圖像
- 12. 顯示圖像的Android應用程序
- 13. 我的應用程序如何在內存中顯示圖像?
- 14. 如何在BlackBerry應用程序中顯示圖像到我的應用程序
- 15. android:在應用程序中只有來自ldpi的圖像顯示
- 16. 如何在windows phone 7應用程序中顯示來自後臺的圖像?
- 17. Android - 如何顯示來自URL的圖像?
- 18. Jquery Mobile應用程序在Android上不顯示某些圖像
- 19. 我如何顯示來自url的圖像?
- 20. 如何在UIscrollView中顯示來自URL的很多圖像
- 21. 如何在我的android gridview中顯示來自互聯網的圖像圖像並顯示完整圖像?
- 22. 如何在Android中顯示來自Uri的位圖圖像?
- 23. 如何在Android應用程序中顯示動畫GIF圖像?
- 24. 如何在Android中加載應用程序時顯示圖像?
- 25. 如何在android中顯示圖片?我的第一個Android應用程序
- 26. Android如何在片段中顯示來自URL的圖片
- 27. 在我的應用程序中顯示圖庫的圖像
- 28. 如何在我的應用程序加載時顯示圖像
- 29. 顯示來自URL的圖像Objective C
- 30. 來自URL的ListField顯示圖像
http://stackoverflow.com/questions/3375166/android-drawable-images-from-url?rq=1 – inankupeli
我看見之間「一個巨大的差異保持圖像更新「和」顯示來自URL的圖像「。 –