java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
2015-03-31 14:12
555 查看
使用baseadapter出现
错误,一般是你自己的实现baseadapter的方法中
public View getView(int arg0, View arg1, ViewGroup arg2) {
// TODO Auto-generated method stub
RelativeLayout view7 = (RelativeLayout)
LayoutInflater
.from(MainActivity.this).inflate(
R.layout.second, null);
这是在你的second布局文件中与这不对应 ,如果你布局文件中用的linearlayout,然后这边也得用linearlayout,如果用的是relativelayout,这边也用relativelayout。
java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams
cannot be cast to android.widget.AbsListView$LayoutParams
错误,一般是你自己的实现baseadapter的方法中public View getView(int arg0, View arg1, ViewGroup arg2) {
// TODO Auto-generated method stub
RelativeLayout view7 = (RelativeLayout)
LayoutInflater
.from(MainActivity.this).inflate(
R.layout.second, null);
这是在你的second布局文件中与这不对应 ,如果你布局文件中用的linearlayout,然后这边也得用linearlayout,如果用的是relativelayout,这边也用relativelayout。
相关文章推荐
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutPara
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.wi
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.R
- :java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.wi
- java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.wid
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.
- java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.wid
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.....
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.L
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.wid