如何发起http请求获取图片链接: http://vec03.maps.yandex.ru/tiles?l=map&v=2.20.0&x=19783&y=10320&z=15 能够添加到 ImageView
请帮忙,我不擅长网络开发。
最佳答案
String imageUrl= "http://vec03.maps.yandex.ru/tiles?l=map&v=2.20.0&x=19783&y=10320&z=15";
URL url = new URL(imageUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
InputStream is = connection.getInputStream();
Bitmap img = BitmapFactory.decodeStream(is);
imageView.setImageBitmap(img );
在你问你的问题之前谷歌它,避免重复的问题
关于Android如何发出http请求以获取ImageView的图像链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11950042/