There is a list, in each element there should be a picture. Pictures in the form of http links.
Is there really no way to load pictures in the main stream without bothering with the creation of new streams?
Of course there is! for this you can use the Picasso library
You need to add it to the project entry in the grad file:
compile 'com.squareup.picasso:picasso:2.5.2' It is very easy to use.
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView); Use libraries, Picasso or UniversalImageLoader , they will do everything for you
Yes, please, you want the main thread, use)):
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); Only sense to freeze the main stream, the application will not be usable.
Source: https://ru.stackoverflow.com/questions/532919/
All Articles