title: ListView with an ArrayAdapter
body: <p>I am trying to create an ArrayAdapter for my ListView to display a list of Contacts, but it is saying that it cannot resolve the constructor for the array adapter. Please can someone help me and tell me if I need to create a custom adapter or not. I have also tried ArrayAdapter> but that doesn't resolve the constructor either. Here is my code:</p>
  
  <pre><code>package com.example.contactmanagement;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.content.Intent;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.LinearLayout;
  import android.widget.ListView;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class MainActivity extends AppCompatActivity {
  
      private static final int ADDCONTACT_REQUEST_CODE = 0;
      int idCounter = 0;
      List&lt;Bundle&gt; contacts = new ArrayList&lt;Bundle&gt;();
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
      }
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data){
          super.onActivityResult(requestCode, resultCode, data);
          Bundle bundle = data.getExtras();
          contacts.add(bundle);
          String fname = bundle.getString("fname");
          String lname = bundle.getString("lname");
          String full_name = fname + " " + lname;
          LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
          LinearLayout layout = (LinearLayout) findViewById(R.id.contactList);
  
          ArrayAdapter&lt;List&gt; itemsAdapter = new ArrayAdapter&lt;List&gt;(this, R.layout.textview, contacts);
          ListView listView = (ListView) findViewById(R.id.lv);
          listView.setAdapter(itemsAdapter);
          /*
          TextView textView = new TextView(this);
          textView.setLayoutParams(params);
          textView.setText(fname +" " + lname);
          textView.setId(idCounter);
          idCounter++;
          textView.setOnClickListener(new View.OnClickListener(){
              @Override
              public void onClick(View v){
                  Intent contactDetails = new Intent("com.example.contactmanagement.ContactDetails");
                  int counterID = v.getId();
                  Bundle bundleToPass = contacts.get(counterID);
                  contactDetails.putExtras(bundleToPass);
                  startActivity(contactDetails);
              }
          });
          layout.addView(textView);
          */
      }
      public void onClick(View view) {
          Intent intent = new Intent(this, AddContact.class);
          startActivityForResult(intent, ADDCONTACT_REQUEST_CODE);
      }
  
  }
  </code></pre>