Android如何制作一个http请求来获取ImageView的图像链接

And*_*ann 1 android http request imageview

如何建立http请求以获取图像链接:http: //vec03.maps.yandex.ru/tiles? l = map&v = 2.20.0&x = 18783&y = 10320&z = 15以便能够添加到ImageView

请帮忙,我不擅长网站开发.

Ven*_*dor 8

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 );
Run Code Online (Sandbox Code Playgroud)

谷歌它在你问你的问题之前,避免重复的问题