2015-06-05 67 views
0

在我的應用程序中,我正在下載一個小型Facebook個人資料圖片並將其顯示在AlertDialog(作爲BitmapDrawable)以及用戶名和姓氏。現在Android - AlertDialog不會顯示BitmapDrawable

,我的問題是,在某些設備上的BitmapDrawableAlertDialog所示(安卓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(); 

有什麼想法嗎?

UPDATE:即使在調試器,我可以看到的圖標,AlertDialog設置和調試器還允許我以查看它的位圖,它的完美顯示。它只是不會出現在對話框中,我不知道爲什麼。

回答

0
  1. 試着從資源中設置一個drawable來看看它是否有效。

  2. 如果我沒有錯,請嘗試更改默認的應用程序主題(這很奇怪,但對我來說它在一些特殊情況下工作)。

而且我發現這個bug報告,同時搜索,

https://code.google.com/p/android/issues/detail?id=92929

+0

接受爲您發佈的bug報告包含解決方案(這更是一個解決辦法) – user2162550