Android ArrayAdapter Errror in AsyncTask
<p>I am having trouble with assigning the adapter to titlesList now... I get the error "The method setAdapter(ArrayAdapter) is undefined for the type ArrayList" What am I doing wrong?</p>

<p>The problem is in the class ShowTitlesTask</p>

<pre><code>package com.aer.illbehonest;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;

import org.apache.commons.io.IOUtils;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class VideoPlay extends Activity {   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_play);

        new ShowTitlesTask().execute("");
    }

    class ShowTitlesTask extends AsyncTask&lt;String, Void, ArrayList&lt;String&gt;&gt; {

    ArrayList&lt;String&gt; titlesList;

    @Override
    protected ArrayList&lt;String&gt; doInBackground(String... args) {

    URL jsonURL = null;
    try {
           jsonURL = new URL("http://gdata.youtube.com/feeds/api/users/illbehonest/uploads?v=2&amp;alt=jsonc");
        } catch (MalformedURLException e3) {
            e3.printStackTrace();
        }
            URLConnection jc = null;
            try {
                jc = jsonURL.openConnection();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
            InputStream is = null;
            try {
                is = jc.getInputStream();
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            String jsonTxt = null;
            try {
                jsonTxt = IOUtils.toString(is);
            } catch (IOException e) {
                e.printStackTrace();
            }

            JSONObject json = (JSONObject) JSONSerializer.toJSON(jsonTxt);

            JSONObject jdata = json.getJSONObject("data");

            JSONArray jentry = jdata.getJSONArray("items");
            for (int entryNumber = 0; entryNumber&lt;=25; entryNumber++){
                    JSONObject entry = jentry.getJSONObject(entryNumber);
                    titlesList.add(entry.getString("title"));
            }

            return titlesList;
    }
    protected void onPostExecute(ArrayList&lt;String&gt; result) {
        ListView listView = (ListView)VideoPlay.this.findViewById(R.id.videolist);

        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt; (VideoPlay.this,
                android.R.layout.simple_list_item_1, android.R.id.text1, titlesList);
        titlesList.setAdapter(arrayAdapter);
        }
    }
}
</code></pre>
