title: Android Studio cannot recognize "setAdapter()" method
body: <p>I have been trying to understand how to populate a ListView and to do that I tried making a simple app that takes a string array and puts it on a listview. I created a ListView object 'myListView' and tried calling the 'setAdapter()' function for this object. But the 'setAdapter' part turns red and it gives me an error message saying,
  "cannot resolve symbol 'setAdapter'"</p>
  
  <p>Following is the source code for MainActivity.java:</p>
  
  <pre><code>import android.app.Activity;
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.ArrayAdapter;
  import android.widget.ListAdapter;
  import android.widget.ListView;
  import android.widget.AbsListView;
  
  public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  String[] myArray = {"biscuits", "laptops", "mice", "headphones", "macBook", "bottles", "something", "also something",
                      "this list is stupid", "and", "dumb", "and", "useless", "okay", "here it ends"};
  
      ListAdapter myListAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_expandable_list_item_1, myArray);
  
      ListView myListView = (ListView) findViewById(R.id.myListView);
  
      myListView.setAdapter(myListAdapter);
  }
  </code></pre>