What is the value of mPlaceHolderBitmap in the Java – Android Developer Page? … here is a solution to the problem.
What is the value of mPlaceHolderBitmap in the Java – Android Developer Page?
I’m new to Android development and I’m trying to replicate an example of using Async Task to display images on a gridview, as shown on Google’s Android development page.
My question is: how do I declare or initialize mPlaceHolderBitmap under the following code:
Here is the link to the Google code:
Displaying Bitmaps in Your UI
public void loadBitmap(int resId, ImageView imageView) {
if (cancelPotentialWork(resId, imageView)) {
final BitmapWorkerTask task = new BitmapWorkerTask(imageView);
final AsyncDrawable asyncDrawable =
new AsyncDrawable(getResources(), mPlaceHolderBitmap, task);
imageView.setImageDrawable(asyncDrawable);
task.execute(resId);
}
}
Solution
Converting @Luksprog turning comments into answers:
It represents your own Bitmap to be used as a placeholder while the actual image is loaded. You can download the sample and see the entire code.