网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Android常见的错误整理(不定时更新)

1.将Bitmap影像到FrameLayout,我解码的图像转换成 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

成都创新互联是一家专注于成都网站制作、网站建设与策划设计,连江网站建设哪家好?成都创新互联做网站,专注于网站建设十载,网设计领域的专业建站公司;建站业务涵盖:连江等地区。连江做网站价格咨询: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常见的错误整理(不定时更新)
当前网址:http://bjjierui.cn/article/piojeo.html

其他资讯