title: setListAdapter unable to be resolved
body: <p>a real amateur developer here in dire need of some assistance. I've been trying to parse JSON data and turn it into a list of items, but I am having difficulties attempting to use the setListAdapter method despite importing it into the class. Any help would be massively appreciated.</p>
  
  <p>Here is my main activity, error is in the onPostExecute method   </p>
  
  <pre><code>import java.io.IOException;
  import java.util.List;
  
  import org.apache.http.client.ClientProtocolException;
  import org.apache.http.client.methods.HttpGet;
  
  import android.app.Activity;
  import android.net.http.AndroidHttpClient;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.ArrayAdapter;
  
  
  public class JSON extends Activity {
  
      // Coordinates used for centering the Map
  
      private final static String UNAME = "aporter";
      private final static String URL = "http://api.geonames.org/earthquakesJSON?north=44.1&amp;south=-9.9&amp;east=-22.4&amp;west=55.2&amp;username="
              + UNAME;
  
      public static final String TAG = "MapsEarthquakeMapActivity";
  
      // Set up UI and get earthquake data
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.main);
  
          new HttpGetTask().execute(URL);
  
      }
  
      private class HttpGetTask extends
              AsyncTask&lt;String, Void, List&lt;GeonameRec&gt;&gt; {
  
          AndroidHttpClient mClient = AndroidHttpClient.newInstance("");
  
          @Override
          protected List&lt;GeonameRec&gt; doInBackground(String... params) {
  
              HttpGet request = new HttpGet(params[0]);
              JSONResponseHandler responseHandler = new JSONResponseHandler();
  
              try {
  
                  // Get Earthquake data in JSON format
                  // Parse data into a list of EarthQuakeRecs
  
                  return mClient.execute(request, responseHandler);
  
              } catch (ClientProtocolException e) {
                  Log.i(TAG, "ClientProtocolException");
              } catch (IOException e) {
                  Log.i(TAG, "IOException");
              }
  
              return null;
  
          }
  
          @Override
          protected void onPostExecute(List&lt;GeonameRec&gt; result) {
  
              if (null != mClient)
                  mClient.close();
              setListAdapter(new ArrayAdapter&lt;String&gt;(
                   JSON.this,
                   R.layout.listitem, result));
  
  
  
          }
      }
  
  }
  }
  </code></pre>
  
  <p>And here is my class where I format the JSON response.</p>
  
  <pre><code>import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  
  import org.apache.http.HttpResponse;
  import org.apache.http.client.ClientProtocolException;
  import org.apache.http.client.ResponseHandler;
  import org.apache.http.impl.client.BasicResponseHandler;
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  import org.json.JSONTokener;
  
  public class JSONResponseHandler implements
      ResponseHandler&lt;List&lt;GeonameRec&gt;&gt; {
  @Override
  public List&lt;GeonameRec&gt; handleResponse(HttpResponse response)
          throws ClientProtocolException, IOException {
      List&lt;GeonameRec&gt; result = new ArrayList&lt;GeonameRec&gt;();
      String JSONResponse = new BasicResponseHandler()
              .handleResponse(response);
      try {
          JSONObject object = (JSONObject) new JSONTokener(JSONResponse)
                  .nextValue();
          JSONArray earthquakes = object.getJSONArray("earthquakes");
          for (int i = 0; i &lt; earthquakes.length(); i++) {
              JSONObject tmp = (JSONObject) earthquakes.get(i);
              result.add(new GeonameRec(
                      tmp.getDouble("lat"),
                      tmp.getDouble("lng")));
          }
      } catch (JSONException e) {
          e.printStackTrace();
      }
      return result;
  }
  
  }
  </code></pre>