title: Adding empty item to the listview
body: <p>I need to implement such a thing. I get a list of items. And when user swipes down the list should swipe showing the empty item of the list and another set of items should be downloaded.  How can I implement this? I have ArrayAdapter class :</p>
  
  <pre><code>public class OrderAdapter extends ArrayAdapter&lt;Order&gt;{
  
  
      Context context; 
      int layoutResourceId;    
      List&lt;Order&gt; orders = null;
  
      public OrderAdapter(Context context,  int layoutResourceId,List&lt;Order&gt; orders) {
          super(context, layoutResourceId, orders);
          this.layoutResourceId = layoutResourceId;
          this.context = context;
          this.orders = orders;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View row = convertView;
          OrderHolder holder = null;
  
          if(row == null)
          {
              Log.i("I'm in OrderAdapter",Integer.toString(layoutResourceId));
  
  
              LayoutInflater inflater = ((Activity)context).getLayoutInflater();
              row = inflater.inflate(R.layout.dash_alt_item, parent, false);
  
              holder = new OrderHolder();
              holder.orderId = (TextView)row.findViewById(R.id.altOrderId);
              holder.orderTitle = (TextView)row.findViewById(R.id.altOrderTitle);
              holder.orderStatus = (TextView)row.findViewById(R.id.altOrderStatus);
              holder.orderPrice = (TextView)row.findViewById(R.id.altOrderPrice);
  
              row.setTag(holder);
          }
          else
          {
              holder = (OrderHolder)row.getTag();
          }
  
          Order order = orders.get(position);
          Log.i("id",Integer.toString(order.getOrderid()));
          holder.orderId.setText(Integer.toString(order.getOrderid()));
          holder.orderTitle.setText(order.getTitle());
          holder.orderStatus.setText(order.getProcess_status().getProccessStatusTitle());
          holder.orderPrice.setText(Float.toString(order.getPrice()));
  
  
          return row;
      }
  
      static class OrderHolder
      {
          TextView orderId;
          TextView orderTitle;
          TextView orderStatus;
          TextView orderPrice;
      }
  }
  </code></pre>
  
  <p>And this is how I download the items:</p>
  
  <pre><code>    private class DownloadTask extends AsyncTask&lt;String, Void, List&lt;Order&gt; &gt; {
              protected List&lt;Order&gt;  doInBackground(String... args) {
  
              try {
                  DashboardActivityAlt.this.getOrderList(Integer.toString(DashboardActivityAlt.page), Integer.toString(DashboardActivityAlt.perpage));
  
  
              } catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
  
                  return forPrint;
  
              }
  
              protected void onPostExecute(List&lt;Order&gt;  forPrint) {
  
  
                  DashboardActivityAlt.this.listView1 = (ListView)findViewById(R.id.altOrderslist);
                  OrderAdapter adapter = new OrderAdapter(DashboardActivityAlt.this, R.layout.dash_alt_item, forPrint);
  
                  listView1.setAdapter(adapter);
  
                  if (DashboardActivityAlt.this.pd != null) {
  
                      DashboardActivityAlt.this.pd.dismiss();
                  }
  
              }
         }
  </code></pre>
  
  <p>I tried to add the empty item of the Order class but got the NullPointerException</p>