How to Efficiently Load 1000 Data in Lists

I have 1000 clients to load in a custom listview from the server. But I need more time to fill the list. I am using the search option to find customers, so I need to download and display all customers in one shot. I cannot display it from the local database because I can edit the details of an item by clicking in the list and store it on the server. Can anyone help me upload to a custom list efficiently?

  public class CustomersAdapter extends ArrayAdapter<Item> {

private ArrayList<Item> items;
private LayoutInflater vi;
private Item objItem;

ViewHolderSectionName holderSection;
ViewHolderName holderName;

public CustomersAdapter(Context context, ArrayList<Item> items) {
    super(context, 0, items);

    this.items = items;
    vi = (LayoutInflater) context

public View getView(final int position, View convertView, ViewGroup parent) {

    objItem = items.get(position);

    if (objItem.isSectionItem()) {
        SectionHeadersModel si = (SectionHeadersModel) objItem;

        if (convertView == null
                || !convertView.getTag().equals(holderSection)) {
            convertView = vi.inflate(R.layout.alphabet_separator, null);

            holderSection = new ViewHolderSectionName();
        } else {
            holderSection = (ViewHolderSectionName) convertView.getTag();

        holderSection.section = (TextView) convertView

    } else {
        CustomerListViewModel ei = (CustomerListViewModel) objItem;

        if (convertView == null || !convertView.getTag().equals(holderName)) {
            convertView = vi.inflate(R.layout.customer_list_item, null);

            holderName = new ViewHolderName();
        } else {
            holderName = (ViewHolderName) convertView.getTag();
        } = (TextView) convertView
                .findViewById(; = (TextView) convertView
                .findViewById(; = (TextView) convertView

        if ( != null)
    return convertView;

public static class ViewHolderName {
    public TextView name;
    public TextView email;
    public TextView phone;

public static class ViewHolderSectionName {
    public TextView section;




source to share

2 answers

Try using viewHolder on your list, it stores each of the component views inside the layout tag field so you can access them immediately without revisiting them. This LINK can help you.



You can use BaseAdapter. see link Link and Link



All Articles