滚动自定义ListView时,Android应用程序崩溃

时间:2015-01-08 06:29:21

标签: android listview crash

当我在AVD上测试我的应用程序时,列表视图可以正常工作而不会崩溃,但是当我使用智能手机(GALAXY S3)时它会在滚动到底部时崩溃(whitout make error message)

@Override
public View getView(int position, View view, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();

View rowView= inflater.inflate(R.layout.fragment_exercice_item_ex, null, true);
TextView txtTitle = (TextView) rowView.findViewById(R.id.exercice_by_m_nom);
ImageView imageView = (ImageView) rowView.findViewById(R.id.exercice_by_m_image);
TextView other = (TextView) rowView.findViewById(R.id.exercice_by_m_other);
TextView equipem = (TextView) rowView.findViewById(R.id.exercice_by_m_equi);

String title = web[position];
String oths = oth[position];
String equs = equ[position];

txtTitle.setText(title);
imageView.setImageResource(imageId[position]);
other.setText(oths);
equipem.setText(equs);

return rowView;
}

我用这段代码设置了适配器。

ExerciceAdapter adapter = new ExerciceAdapter(getActivity(), exearr, imagearr,otharr,equiarr);
            list=(ListView)rootView.findViewById(R.id.lv_fragment_exercice);
            list.setAdapter(adapter);

1 个答案:

答案 0 :(得分:0)

@ MM-BB它不会产生任何错误,它只是最小化应用程序