title: How to properly add data to ArrayList - Android
body: <p>I have a class the extends arrayAdapter. I am trying to add variables to the list but I am not sure exactly how to do so. Here is my current ArrayAdapter class.</p>
  
  <pre><code>class Item {
                  String username;
                  String number;
                  String content;
  
              }         
               class ListAdapter extends ArrayAdapter&lt;Item&gt; {    
                  public ListAdapter(Context context, int textViewResourceId) {
                      super(context, textViewResourceId);
                      // TODO Auto-generated constructor stub
                  }    
                  private List&lt;Item&gt; items;    
                  public ListAdapter(Context context, int resource, List&lt;Item&gt; items)      
                     {    
                      super(context, resource, items);    
                      this.items = items;    
                  }
  
                  @Override
                  public View getView(int position, View convertView, ViewGroup parent) {
  
                      View v = convertView;
  
                      if (v == null) {
  
                          LayoutInflater vi;
                          vi = LayoutInflater.from(getContext());
                          v = vi.inflate(R.layout.list_item, null);
  
                      }
  
                      final Item p = items.get(position);
  
                      if (p != null) {
  
  
                          TextView commentView = (TextView)v.findViewById(R.id.listComment);
                          TextView NumbersView = (TextView)v.findViewById(R.id.listNumber);
                          TextView usernamesView = (TextView)v.findViewById(R.id.listPostedBy);
  
  
                          commentView.setText(p.content);
                          NumbersView.setText(p.number);
                          usernamesView.setText(p.username);
  
  
  
  
  
                      }
  
                      return v;
  
                  }
               }
  
  
  
                  ListView yourListView = (ListView) findViewById(android.R.id.list);
  
  
                  ListAdapter customAdapter = new ListAdapter(DashboardActivity.this, R.layout.list_item, tempList);
  
                  yourListView .setAdapter(customAdapter);
  </code></pre>
  
  <p>Here is where I add Data to the ArrayList,</p>
  
  <pre><code>final List &lt;Item&gt; tempList = new ArrayList &lt;Item&gt;();
  
  
          String username = json2.getString(KEY_USERNAME);
          String number = json2.getString(KEY_NUMBER);
          String content = json2.getString(KEY_COMMENT);
  
         //The Error occurs here
          tempList.add ( new Item (username, number,content));
  </code></pre>
  
  <p>The Error says <code>The constructor ClipData.Item(String, String, String) is 
   undefined</code></p>