After watching here I try to implement my own efficient adapter,
My ViewHolder class almost same:
static class ViewHolder {
ImageButton button;
TextView txtView;
}
getView method look like:
private void getView(...) {
if(convertView == null) {
convertView = LayoutInflater.from(
parent.getContext()).inflate(R.layout.linear_container,
parent, false);
holder = new ViewHolder();
convertView.setTag(holder);
} else {
// erro line
holder = (ViewHolder) convertView.getTag();
}
LinearLayout llCustomImgViewContainer = (LinearLayout) convertView
.findViewById(R.id.llContainer);
llCustomImgViewContainer.setTag(viewPosition);
return converView;
}
but here once new view started to draw, it give me error
D/AndroidRuntime( 748): Shutting down VM W/dalvikvm( 748): threadid=1: thread exiting with uncaught exception (group=0x412a4300) E/AndroidRuntime( 748): FATAL EXCEPTION: main E/AndroidRuntime( 748): java.lang.ClassCastException: java.lang.Integer cannot be cast to com.droid.test.widget.customListView$CustomBaseAdapter$ViewHolder
any one have idea what is wrong here?