Top 10 iOS App Development Companies in India
iOS apps for iPhones and iPads are essential for many users, serving needs from entertainment to business. India has become a key player in iOS app development, thanks to its […]
The getView() method of the class extending the BaseAdapter holds the state of the currently displayed view which is invalidated when scrolling the listview. So, in order to avoid this problem, proceed in the following manner.
• Create a nested class within the class (class which is extending BaseAdapter Class), namely, Viewholder.
• Declare all the views of an individual list item in this Viewholder Class.
• Create an object of this Viewholder class in the getView() method and initialize all the views declared in the Viewholder class using this object.
Example :
Activity activity;
publicclassViewHolder{
TextViewtextview;
CheckBoxcheckbox;
}
public View getView(finalint position, View convertView, ViewGroup parent)
{
View vi=convertView;
LayoutInflaterinflater = activity.getLayoutInflater();
vi = inflater.inflate (R.layout.listitem, null);
ViewHolder item=newViewHolder();
item.textview = (TextView)vi.findViewById(R.id.textview1);
item.checkbox = (CheckBox)vi.findViewById(R.id.checkbox1);
vi.setTag(item);
return vi;
}
Implement this and check the state of the checkbox while scrolling the listview.
Jul 24th, 2025
iOS apps for iPhones and iPads are essential for many users, serving needs from entertainment to business. India has become a key player in iOS app development, thanks to its […]
Jul 22nd, 2025
Dining out is no longer just about delicious food—it’s about convenience, speed, and experience. In today’s fast-moving world, waiting for a table or calling to reserve one is a thing […]
Jul 17th, 2025
Businesses are always looking for innovative ways to enhance user experiences and stay competitive. One technological advancement making waves globally, especially in Singapore, is the Progressive Web App (PWA). PWAs […]