Android - adapter code does not compile
<p>I have some code which I think should compile, but doesn't:</p>

<pre><code>import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.problemio.ViewSolutionsActivity.DownloadWebPageTask;
import com.problemio.data.Discussion;
import com.problemio.data.DiscussionMessage;
import com.problemio.data.SuggestedSolution;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class TopicActivity extends Activity 
{
    ArrayAdapter&lt;Discussion&gt; adapter;       

    ArrayList&lt;Discussion&gt; discussion = new ArrayList &lt;Discussion&gt;( );   

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.discussion);

        // Have to display the topic, and the existing discussion, and the form field.



        Discussion d = new Discussion ();
        d.setDiscussionTopicName( "Please wait while the discussion comments load" );

        discussion.add(d);
        adapter = new ArrayAdapter&lt;Discussion&gt;( this,R.layout.discussion_comments, discussion);

        setListAdapter(adapter);

        ListView lv = getListView();
        lv.setTextFilterEnabled(true);
</code></pre>

<p>There is more code below but the line with setListAdapter(adapter); gives this error: </p>

<pre><code>The method setListAdapter(ArrayAdapter&lt;Discussion&gt;) is undefined for the type TopicActivity
</code></pre>

<p>Any idea why? I actually copied this code from another class and it worked well there.</p>

<p>Thanks!</p>
