text link : A code load network pictures to imageview--android Picasso
Introduce an android framework here: Picasso.
Picasso is an open source Android graphics cache Library at square, address http://square.github.io/picasso/, which allows for image download and caching capabilities. Just one line of code is required to fully implement the asynchronous loading of the image. The code is as follows:
Public classMainactivityextendsActivity {PrivateImageView ImageView; PrivateString url= "Http://h.hiphotos.baidu.com/image/pic/item/64380cd7912397dd6e6c3adf5c82b2b7d1a287d0.jpg"; @Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.activity_main); ImageView=(ImageView) Findviewbyid (R.id.testimageid); Picasso.with ( This ). Load (URL). into (ImageView); }}
The key line of code:
Picasso.with (this). Load (URL). into (ImageView);
In the test, you still need to be in Androidmanifest.xml plus access to network permissions.
<android:name= "Android.permission.INTERNET"/>
"Reprint" A line of code load Network pictures to imageview--android Picasso