在活动中得到以下代码:
LinearLayout view = (LinearLayout) this.findViewById(R.id.viewid);
Drawable drawable = getResources().getDrawable(R.drawable.drawableid);
if (Build.VERSION.SDK_INT >= 16)
    view.setBackground(drawable);
else
    view.setBackgroundDrawable(drawable);
Eclipse 给我一个错误setBackground:“调用需要 API 级别 16(当前最低为 8):android.widget.LinearLayout#setBackground”,并警告setBackgroundDrawable:“不推荐使用 View 类型的方法 setBackgroundDrawable(Drawable)”。我无法用这个错误编译我的项目。
为什么 ADT 在版本检查中没有检测到这两种setBackground*方法都有效?