title: Displaying a string into a listview
body: <p>I successfully parsed data from this <a href="http://ec2-54-213-155-95.us-west-2.compute.amazonaws.com/notices.php" rel="nofollow">website here</a>. After writing a few codes, I get a string in which I would like to display into a ListView. Basically, I want to display the whole array from the website into a ListView.</p>
  
  <pre><code>DefaultHttpClient   httpclient = new DefaultHttpClient(new BasicHttpParams());
  HttpPost httppost = new HttpPost("http://ec2-54-213-155-95.us-west-2.compute.amazonaws.com/notices.php");
  // Depends on your web service
  httppost.setHeader("Content-type", "application/json");
  
      InputStream inputStream = null;
      String result = null;
      try {
          HttpResponse response = httpclient.execute(httppost);           
          HttpEntity entity = response.getEntity();
  
          inputStream = entity.getContent();
          // json is UTF-8 by default
          BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8);
          StringBuilder sb = new StringBuilder();
  
          String line = null;
          while ((line = reader.readLine()) != null)
          {
              sb.append(line + "\n");
          }
          result = sb.toString();
      } catch (Exception e) { 
          // Oops
      }
      finally {
          try{if(inputStream != null)inputStream.close();}catch(Exception squish){}
      }
  
      try {
          JSONObject jObject = new JSONObject(result);
          JSONArray jsonArray = jObject.getJSONArray("notices");        
          for(int i = 0; i &lt; jsonArray.length(); i++) {
              String arrayString = jsonArray.getString(i);
              Log.d("notices", arrayString); 
              ListView listView1 = (ListView) findViewById(R.id.listView1);
  
  
      } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I am thinking of using arrayAdapter but I am not to sure of how to use it! </p>