我是 Android 开发的新手,我正在尝试复制使用 Async Task 在 gridview 上显示图像的示例,如 Google 的 Android 开发页面所示。 我的问题是:如何在以下代码下声明或初始化 mPlaceHolderBitmap: 这是谷歌代码的链接: 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);
}
}
最佳答案
正在转换 @Luksprog将评论转化为答案:
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.
关于java - Android Developer Page中mPlaceHolderBitmap的值是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20826988/