gpt4 book ai didi

java - Android Developer Page中mPlaceHolderBitmap的值是多少?

转载 作者:太空宇宙 更新时间:2023-11-03 11:13:37 24 4
gpt4 key购买 nike

我是 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com