Update ArrayList<HashMap<String to ListView (undefined simpleadapter error)
<p>I am trying to update a listview with the content in an <code>ArrayList&lt;HashMap&lt;String, String&gt;&gt;</code>. I dont understand why I am getting the following error: </p>

<p>The constructor <code>SimpleAdapter(Main.getResults, ArrayList&lt;HashMap&lt;String,String&gt;&gt;, int, String[])</code> is undefined</p>

<pre><code>public class Main extends Activity {

private static String personURL = "http://api.themoviedb.org/3/search/person?api_key=bb0b6d66c2899aefb4d0863b0d37dc4e&amp;query=";

private static String TAG_CAST = "cast";
private static String TAG_ID = "id";

private static String TAG_TITLE = "title";

String title = null;

JSONArray idOne = null;
JSONArray idTwo = null;

JSONArray firstCast = null;
JSONArray secondCast = null;


EditText searchOne;
EditText searchTwo;

Button findMovies;

List&lt;String&gt; searchOneFilmography = new ArrayList&lt;String&gt;();
List&lt;String&gt; searchTwoFilmography = new ArrayList&lt;String&gt;();
ArrayList&lt;HashMap&lt;String, String&gt;&gt; commonFilmogrpahy = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();




@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.totlayout);

    searchOne = (EditText) findViewById(R.id.searchOne);
    searchTwo = (EditText) findViewById(R.id.searchTwo);

    findMovies = (Button) findViewById(R.id.findMovies);



    //getting

    findMovies.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub


            new getResults().execute();

        }
    });
}
public class getResults extends AsyncTask&lt;String, Void, ArrayList&lt;HashMap&lt;String, String&gt;&gt; &gt; {

    @Override
    protected ArrayList&lt;HashMap&lt;String, String&gt;&gt; doInBackground(
            String... params) {
        // TODO Auto-generated method stub

        //get names from each text box

        ArrayList&lt;HashMap&lt;String, String&gt;&gt; commonFilms = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
        ArrayList&lt;HashMap&lt;String, String&gt;&gt; firstFilms = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
        ArrayList&lt;HashMap&lt;String, String&gt;&gt; secondFilms = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
        String nameOne = searchOne.getText().toString();
        String nameTwo = searchTwo.getText().toString();

        nameOne = nameOne.replace(" ", "_");
        nameTwo = nameTwo.replace(" ", "_");

        String searchOneURL = personURL + nameOne;
        String searchTwoURL = personURL + nameTwo;

        //Hashmap for ListView


        //Create JSON Parser Instanece
        JSONParser jParser = new JSONParser();

        //getting JSON string from url
        JSONObject jsonOne = jParser.getJSONFromUrl(searchOneURL);
        JSONObject jsonTwo = jParser.getJSONFromUrl(searchTwoURL);


        try {
            //Get ID of each person
            idOne = jsonOne.getJSONArray(TAG_ID);
            idTwo = jsonTwo.getJSONArray(TAG_ID);


            String firstID = null;
            String secondID = null;
            for(int i = 0; i &lt; idOne.length(); i++){
                JSONObject iDeeOne = idOne.getJSONObject(i);

                //store each json item in variable
                firstID = iDeeOne.getString(TAG_ID);

            }

            for(int i = 0; i &lt; idTwo.length(); i++){
                JSONObject iDeeTwo = idTwo.getJSONObject(i);

                //store each json item in variable
                secondID = iDeeTwo.getString(TAG_ID);
            }
            String creditURlBase = "http://api.themoviedb.org/3/person";

            String firstCreditURL = creditURlBase + firstID;
            String secondCreditURL = creditURlBase + secondID;

            JSONObject jSon = jParser.getJSONFromUrl(firstCreditURL);


            firstCast = jSon.getJSONArray(TAG_CAST);
            for(int i = 0; i &lt; firstCast.length(); i++){
                JSONObject c = firstCast.getJSONObject(i);
                title = c.getString(TAG_TITLE);

                //ctreate new hashmap
                HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();

                //and node to map
                map.put(TAG_TITLE, title);
                firstFilms.add(map);

            }
            JSONObject jSonTwo = jParser.getJSONFromUrl(secondCreditURL);

            secondCast = jSonTwo.getJSONArray(TAG_CAST);
            for(int i = 0; i &lt; secondCast.length(); i++){
                JSONObject c = firstCast.getJSONObject(i);
                title = c.getString(TAG_TITLE);

                //create hashmap
                HashMap&lt;String, String&gt; mapTwo = new HashMap&lt;String, String&gt;();

                mapTwo.put(TAG_TITLE, title);
                secondFilms.add(mapTwo);


            }

            if(firstFilms.size() &gt; secondFilms.size()){
                for(int i = 0; i &lt; firstFilms.size(); i++){
                    if(firstFilms.contains(secondFilms.get(i))){

                        HashMap&lt;String, String&gt; mapThree = new HashMap&lt;String, String&gt;();

                        mapThree.put(TAG_TITLE, secondFilms.get(i).toString());
                        commonFilms.add(mapThree);
                    }

                }

            }else{
                for(int i = 0; i &lt; secondFilms.size(); i++){
                    if(secondFilms.contains(firstFilms.get(i))){
                        HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                        map.put(TAG_TITLE, firstFilms.get(i).toString());
                        commonFilms.add(map);
                    }
                }
            }
            return commonFilms;




            }
        catch(JSONException e){
            Log.e("Error", e.toString());
            return null;
        }
        ListAdapter adapter = new SimpleAdapter(this, commonFilms, R.layout.resultslayout, new String[] {TAG_NAME});
        setListAdapter(adapter);
</code></pre>

<p>I have also tried</p>

<pre><code>ListAdapter adapter = new SimpleAdapter(Main.this, commonFilms, R.layout.resultslayout, new String[] {TAG_NAME});
</code></pre>

<p>I still get the same undefined error just for Main.this instead. </p>
