public class

ContactPhotoLoader

extends Object
implements Handler.Callback
java.lang.Object
   ↳ com.android.contacts.ContactPhotoLoader

Class Overview

Asynchronously loads contact photos and maintains cache of photos. The class is mostly single-threaded. The only two methods accessed by the loader thread are #cacheBitmap and #obtainPhotoIdsToLoad. Those methods access concurrent hash maps shared with the main thread.

Summary

Public Constructors
ContactPhotoLoader(Context context, int defaultResourceId)
Constructor.
Public Methods
void clear()
boolean handleMessage(Message msg)
Processes requests on the main thread.
void loadPhoto(ImageView view, long photoId)
Load photo into the supplied image view.
void pause()
Temporarily stops loading photos from the database.
void resume()
Resumes loading photos from the database.
void stop()
Stops loading images, kills the image loader thread and clears all caches.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Handler.Callback

Public Constructors

public ContactPhotoLoader (Context context, int defaultResourceId)

Constructor.

Parameters
context content context
defaultResourceId the image resource ID to be used when there is no photo for a contact

Public Methods

public void clear ()

public boolean handleMessage (Message msg)

Processes requests on the main thread.

public void loadPhoto (ImageView view, long photoId)

Load photo into the supplied image view. If the photo is already cached, it is displayed immediately. Otherwise a request is sent to load the photo from the database.

public void pause ()

Temporarily stops loading photos from the database.

public void resume ()

Resumes loading photos from the database.

public void stop ()

Stops loading images, kills the image loader thread and clears all caches.