在我的应用程序中,我正在下载一张小的 Facebook 个人资料图片,并将其与用户的名字和姓氏一起显示在AlertDialog
(as ) 中。BitmapDrawable
现在,我的问题是,在某些设备上BitmapDrawable
显示在AlertDialog
(Android ~4.0)中,而在某些设备上则不显示(5.0 及更高版本),但在所有设备中都BitmapDrawable
包含正确的位图,我能够加载那个BitmapDrawable
例如ImageView
。
((ImageView)findViewById(R.id.imageView3)).setImageDrawable(bitmapDrawable); //Shown in the ImageView on all devices
AlertDialog ad = new AlertDialog.Builder(MainActivity.this)
.setTitle("From: " + name + " " + lastName)
.setMessage(theStr)
.setNeutralButton(theStr2, new myClick(marker, thePack))
.setIcon(bitmapDrawable) //Not shown in the AlertDialog on all devices
.show();
任何的想法?
更新:即使在调试器中,我也可以看到图标集,AlertDialog
调试器也允许我查看它的位图,并且显示完美。它只是不会出现在对话框中,我不知道为什么。