1.將Bitmap影像到FrameLayout,我解碼的圖像轉(zhuǎn)換成 Drawable ,然后將其設置為背景的 FrameLayout java.lang.NoSuchMethodError: android.widget.FrameLayout.setBackground() ByteArrayInputStream p_w_picpathStream2= new ByteArrayInputStream(cardbackground); Bitmap Imagebackground = BitmapFactory.decodeStream(p_w_picpathStream2); Drawable p_w_picpathbakground=new BitmapDrawable(getResources(),Imagebackground); framelayout.setBackground(p_w_picpathbakground);
解決方法:setBackground()方法,在添加 API 級別 16。使用 setBackgroundDrawable()相反用setBackground
成都創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站制作、網(wǎng)站建設與策劃設計,連江網(wǎng)站建設哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設十載,網(wǎng)設計領域的專業(yè)建站公司;建站業(yè)務涵蓋:連江等地區(qū)。連江做網(wǎng)站價格咨詢:18980820575
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { framelayout.setBackground(p_w_picpathbakground); } else { frameLayout.setBackgroundDrawable(p_w_picpathbakground); }
2.錯誤信息 [2015-11-22 17:19:10 - news] Found 2 versions of android-support-v4.jar in the dependency list, [2015-11-22 17:19:10 - news] but not all the versions are identical (check is based on SHA-1 only at this time). [2015-11-22 17:19:10 - news] All versions of the libraries must be the same at this time. [2015-11-22 17:19:10 - news] Versions found are: [2015-11-22 17:19:10 - news] Path: E:\android\adt-bundle-windows-x86-20131030\workspace\library\libs\android-support-v4.jar [2015-11-22 17:19:10 - news] Length: 385685 [2015-11-22 17:19:10 - news] SHA-1: 48c94ae70fa65718b382098237806a5909bb096e [2015-11-22 17:19:10 - news] Path: E:\android\adt-bundle-windows-x86-20131030\workspace\news\libs\android-support-v4.jar [2015-11-22 17:19:10 - news] Length: 621451 [2015-11-22 17:19:10 - news] SHA-1: 5896b0a4e377ac4242eb2bc785220c1c4fc052f4 [2015-11-22 17:19:10 - news] Jar mismatch! Fix your dependencies 解決方案: 把一個項目的android-support-v4.jar復制到另一個項目覆蓋原來的android-support-v4.jar
新聞標題:Android常見的錯誤整理(不定時更新)
URL標題:http://muchs.cn/article40/piojeo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設計、全網(wǎng)營銷推廣、網(wǎng)站營銷、用戶體驗、做網(wǎng)站、服務器托管
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)