Skip to content Skip to sidebar Skip to footer

Android Base Adapter Does Not Adapter All Rows

I have two datetimes 12/01/2014 and 12/10/2014.i changed datetime format and i also checked different between there two datetime and i also incremented days between there datetimes

Solution 1:

Remove the } else block around the ViewHolder extraction. Move the Holder initialization to after the if{ block. And try now.

if (convertView == null) {

    LayoutInflaterinflater= ((Activity) mContext).getLayoutInflater();
    convertView = inflater.inflate(R.layout.cinema_holl_adapter,
            parent, false);

    ViewHolderItemnewViewHolder=newViewHolderItem();
    newViewHolder.start_time = (TextView) convertView
            .findViewById(R.id.adapter_day);

    convertView.setTag(newViewHolder);

}

ViewHolderItemviewHolder= (ViewHolderItem) convertView.getTag(); //This should be called always/* Rest of your code */

EDIT: What does this block do?

if (position < objectItem.getStartTimePeriod().size()) {
        String starttimes = objectItem.getStartTimePeriod().get(
                position);
        viewHolder.start_time.setText(starttimes);

}

Post a Comment for "Android Base Adapter Does Not Adapter All Rows"