title: Customer adapter for an arraylist and three arrays doesn't wpopulate listview when all data structures have valid values
body: <p>I've an arraylist and 3 arrays all of them containing valid values. I'm trying to display them in an arraylist but nothing is being displayed. No error whatsoever. </p>
  
  <p>Here's my code for the adapter:</p>
  
  <pre><code>public class CustomAdapter extends BaseAdapter {
      Context context;
      ArrayList&lt;String&gt; brands;
      int[] ard,chmd,brandTotal;
      LayoutInflater inflater;
      public CustomAdapter(Context context,ArrayList&lt;String&gt; brands,int[] ard, int[] chmd,int[] brandTotal){
          this.context=context;
          this.brands=brands;
          this.ard=ard;
          this.chmd=chmd;
          this.brandTotal=brandTotal;
          inflater = (LayoutInflater)context.
                  getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      }
      @Override
      public int getCount() {
          return brands.size();
      }
  
      @Override
      public Object getItem(int position) {
          return position;
      }
      public class Holder
      {
          TextView brand;
          TextView ard;
          TextView chmd;
          TextView total;
  
      }
  
      @Override
      public long getItemId(int position) {
          return position;
  
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          Holder holder=new Holder();
          View rowView;
          rowView = inflater.inflate(R.layout.reportview, parent);
          holder.brand=(TextView) rowView.findViewById(R.id.brandText);
          holder.ard=(TextView) rowView.findViewById(R.id.ardCount);
          holder.chmd=(TextView) rowView.findViewById(R.id.chmdCount);
          holder.total=(TextView) rowView.findViewById(R.id.totalCount);
          holder.brand.setText(brands.get(position));
          holder.ard.setText(String.valueOf(ard[position]));
          holder.chmd.setText(String.valueOf(chmd[position]));
          holder.total.setText(String.valueOf(brandTotal[position]));
          return rowView;
      }
  }
  </code></pre>
  
  <p>Here's the code where I'm invoking the adapter:</p>
  
  <pre><code>public class ReportFragment extends Fragment {
  
  
      DatabaseReference db,mdb;
      ArrayList&lt;Item&gt; items=new ArrayList&lt;Item&gt;();
      ArrayList&lt;String&gt; brands =new ArrayList&lt;&gt;();
      Query query;
      ListView listView;
      TextView t1,t2,t3;
      public ReportFragment() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_report, container, false);
      }
  
      @Override
      public void onActivityCreated(@Nullable Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          listView=(ListView)getView().findViewById(R.id.reportList);
          t1=(TextView)getView().findViewById(R.id.ardTotal);
          t2=(TextView)getView().findViewById(R.id.chmdTotal);
          t3=(TextView)getView().findViewById(R.id.total);
          db= FirebaseDatabase.getInstance().getReferenceFromUrl("https://stockmanager-142503.firebaseio.com/Sold");
          mdb=FirebaseDatabase.getInstance().getReferenceFromUrl("https://stockmanager-142503.firebaseio.com/Brands");
          query=db.orderByChild("date");
          query.addChildEventListener(new ChildEventListener() {
              @Override
              public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                  Item i=dataSnapshot.getValue(Item.class);
                  items.add(i);
              }
  
              @Override
              public void onChildChanged(DataSnapshot dataSnapshot, String s) {
  
              }
  
              @Override
              public void onChildRemoved(DataSnapshot dataSnapshot) {
  
              }
  
              @Override
              public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
          Query q=mdb.orderByChild("brandName");
          q.addChildEventListener(new ChildEventListener() {
              @Override
              public void onChildAdded(DataSnapshot dataSnapshot, String s) {
              brands.add(dataSnapshot.getValue(Brand.class).getBrandName());
  
              }
  
              @Override
              public void onChildChanged(DataSnapshot dataSnapshot, String s) {
  
              }
  
              @Override
              public void onChildRemoved(DataSnapshot dataSnapshot) {
  
              }
  
              @Override
              public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
  
          }
  
  
          t1.setText(String.valueOf(totalArd));
          t2.setText(String.valueOf(totalChmd));
          t3.setText(String.valueOf(itemCount));
      listView.setAdapter(new CustomAdapter(getActivity(),brands,ard,chmd,brandTotal));
  
      }
  }
  </code></pre>
  
  <p>All my arrays and arraylist have valid data in them. I've checked by printing them all out in a toast. Can't figure out why the adapter is not working. I don't get any errors either. Please help me out. Thank you</p>