Q:

Empty Listbox is showing in the Listview

i have created a list view in my android project and its showing an empty list at the beginning of the ListView.  All the data is showing accurately from the database.  but it creates a null list at the top of the List view.  for example if we are taking one record from the database, two records are showing.  first record is null as shown in the picture here 

I dont know the fault is in the custom adapter or the listview.  several days i have searched for an solution and could not find.  Please assist me to complete the project.  thanks. 
below i will past my custom adapter code and the ListView
Custom Adapter
else {      
LISTVIEW = (ListView) findViewById(R.id.listView1);

customAdapter = new CustomAdapter();
LISTVIEW.setAdapter(customAdapter);
LISTVIEW.setTranscriptMode(ListView. TRANSCRIPT_MODE_ALWAYS_SCROLL);
LISTVIEW.setStackFromBottom(true);

}

static class ViewHolder {
    TextView ord_num;
    TextView cus_name;
    TextView cus_tel;
    TextView ord_status;
}

class CustomAdapter extends BaseAdapter {

    @Override
    public int getCount() {
        return ID_ArrayList.size() + 1;
    }

    @Override
    public int getViewTypeCount() {
        return getCount();
    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

    @Override
    public Object getItem(int i) {
        return i;
    }

    @Override
    public long getItemId(int i) {
        return -1;
    }

  @Override
  public View getView(int i, View view, ViewGroup viewGroup) {

        ViewHolder holder = null;
        if (view == null) {

            view = getLayoutInflater().inflate(R.layout.listtemplate, viewGroup,false);

            holder = new ViewHolder();
            holder.ord_num = (TextView) findViewById(R.id.lblID);
            holder.cus_name = (TextView) findViewById(R.id.cus_name);
            holder.cus_tel = (TextView) findViewById(R.id.cus_tel);
            holder.ord_status = (TextView) findViewById(R.id.ord_status);
            view.setTag(holder);

        } else {
            holder = (ViewHolder) view.getTag();

        }

        try {

            holder.ord_num.setText("Order ID :" + ID_ArrayList.get(i));
            holder.cus_name.setText("Name : " + NAME_ArrayList.get(i));
            holder.cus_tel.setText("Telephone No : " + PHONE_NUMBER_ArrayList.get(i));
            holder.ord_status.setText("Status : " + STATUS_ArrayList.get(i));

        } catch (Exception ex) {
            System.out.println(ex);
        }

        final int a=i;

        view.findViewById(R.id.item_info).setOnClickListener(new View. OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, View_Items.class);

                String x = getItem(a).toString();
                String y = ID_ArrayList.get(Integer.parseInt(x)-1).toString();

                AlertDialog. Builder alt = new AlertDialog. Builder(MainActivity.this)
                        .setTitle("HI")
                        .setMessage(y);

                alt.setPositiveButton("Ok", new DialogInterface. OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {

                    }
                });
                alt.show();

            }
        });

        return (view ! = null) ?  view : null;

Here is My ListView
android:layout_width="match_parent"
android:layout_height="match_parent"

tools:context="com.a_hamoud.listview_sqlserver. MainActivity"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">

<ListView

    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="8"

    >

</ListView>

Please help me to find where the error is. 
Thanks. 

A:

Try change:
        holder.ord_num = (TextView) findViewById(R.id.lblID);
        holder.cus_name = (TextView) findViewById(R.id.cus_name);
        holder.cus_tel = (TextView) findViewById(R.id.cus_tel);
        holder.ord_status = (TextView) findViewById(R.id.ord_status);

to:
        holder.ord_num = (TextView) view.findViewById(R.id.lblID);
        holder.cus_name = (TextView) view.findViewById(R.id.cus_name);
        holder.cus_tel = (TextView) view.findViewById(R.id.cus_tel);
        holder.ord_status = (TextView) view.findViewById(R.id.ord_status);

Also remove the +1 in getCount().  Hope that helps!