1.将Bitmap影像到FrameLayout,我解码的图像转换成Drawable,然后将其设置为背景的FrameLayoutjava.lang.NoSuchMethodError:android.widget.FrameLayout.setBackground()ByteArrayInputStreamp_w_picpathStream2=newByteArrayInputStream(cardbackground);BitmapImagebackground=BitmapFactory.decodeStream(p_w_picpathStream2);Drawablep_w_picpathbakground=newBitmapDrawable(getResources(),Imagebackground);framelayout.setBackground(p_w_picpathbakground);

解决方法:setBackground()方法,在添加 API 级别 16。使用 setBackgroundDrawable()相反用setBackground

if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.JELLY_BEAN){framelayout.setBackground(p_w_picpathbakground);}else{frameLayout.setBackgroundDrawable(p_w_picpathbakground);}

2.错误信息[2015-11-2217:19:10-news]Found2versionsofandroid-support-v4.jarinthedependencylist,[2015-11-2217:19:10-news]butnotalltheversionsareidentical(checkisbasedonSHA-1onlyatthistime).[2015-11-2217:19:10-news]Allversionsofthelibrariesmustbethesameatthistime.[2015-11-2217:19:10-news]Versionsfoundare:[2015-11-2217:19:10-news]Path:E:\android\adt-bundle-windows-x86-20131030\workspace\library\libs\android-support-v4.jar[2015-11-2217:19:10-news]Length:385685[2015-11-2217:19:10-news]SHA-1:48c94ae70fa65718b382098237806a5909bb096e[2015-11-2217:19:10-news]Path:E:\android\adt-bundle-windows-x86-20131030\workspace\news\libs\android-support-v4.jar[2015-11-2217:19:10-news]Length:621451[2015-11-2217:19:10-news]SHA-1:5896b0a4e377ac4242eb2bc785220c1c4fc052f4[2015-11-2217:19:10-news]Jarmismatch!Fixyourdependencies解决方案:把一个项目的android-support-v4.jar复制到另一个项目覆盖原来的android-support-v4.jar