天天看點

UIL神器

?

代碼片段

01

02

03

04

05

06

07

08

09

<

manifest

>

<

uses-permission

android:name

=

"android.permission.INTERNET"

/>

<!-- Include next permission if you want to allow UIL to cache p_w_picpaths on SD card -->

<

uses-permission

android:name

=

"android.permission.WRITE_EXTERNAL_STORAGE"

/>

...

<

application

android:name

=

"MyApplication"

>

...

</

application

>

</

manifest

>

3. 修改Application,初始化ImageLoader

10

11

12

public

class

MyApplication

extends

Application {

@Override

public

void

onCreate() {

super

.onCreate();

//  

ImageLoaderConfiguration config =

new

ImageLoaderConfiguration.Builder(getApplicationContext())

...

.build();

ImageLoader.getInstance().init(config);

}

}

3. 可以使用啦

// Load p_w_picpath, decode it to Bitmap and display Bitmap in ImageView

p_w_picpathLoader.displayImage(p_w_picpathUri, p_w_picpathView);