2013-02-10 53 views
0

此代碼給出運行時異常,我無法捕捉它。 BitmapFactory.decodeByteArray不會返回null或類似的東西。BitmapFactory.decodeByteArray運行時異常

Bitmap bitmap = BitmapFactory.decodeByteArray(imbBytes, 0, imbBytes.length); 

注意:當imbBytes是.png的byte []給出錯誤時,.JPG沒有。 我試圖保存目錄中的PNG圖像,以檢查是否字節[]是正確的,一切正常。

請幫忙!!!

+1

運行時異常是什麼? logcat的?任何細節? – Geobits 2013-02-10 21:14:26

回答

1

the documentation

返回解碼的位圖,或者圖像不能解碼空。

+0

是我知道,但它不會返回null!我正在使用google api 15 – 2013-02-10 21:13:03

+1

抱歉誤讀。你能發佈確切的錯誤和產生它的線嗎? – user000001 2013-02-10 21:14:02

+0

沒有打印在LogCat上我只在斷點表達式窗口中看到錯誤:發生異常:java.lang.OutOfMemoryError,然後在eclipse的屏幕上顯示「Source not Found」 – 2013-02-10 21:21:01