title: List view with Simple Adapter not showing text
body: <p>I have asked similar question today where the problem was with Array adapter.
  I have tried now to set up List view with Simple adapter because i need header row and subrow with content.</p>
  
  <p>Program starts without errors but screen is blank.</p>
  
  <p>EDIT: Ive updated code, it now runs without problem. I think that problem was in Jsoup query for contentNode.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    package com.example.studentservis;
  
      import java.util.ArrayList;
      import java.util.HashMap;
      import java.util.List;
      import java.util.Map;
  
      import android.R.string;
      import android.os.AsyncTask;
      import android.os.Bundle;
      import android.os.Handler;
      import android.app.Activity;
      import android.content.Context;
      import android.view.Menu;
      import android.widget.ArrayAdapter;
      import android.widget.ListView;
      import android.widget.SimpleAdapter;
      import android.widget.TextView;
      import org.jsoup.Jsoup;
      import org.jsoup.nodes.Document;
      import org.jsoup.select.Elements;
  
      public class MainActivity extends Activity  {
  
  
  
          List&lt;String&gt; headersList = new ArrayList&lt;String&gt;();
          List&lt;String&gt; contentList = new ArrayList&lt;String&gt;();
          ListView listview;
          StableArrayAdapter adapter1;
          String from[] = {"naslov","sadrzaj"};
          int [] to =  { android.R.id.text1, android.R.id.text2 };
  
          SimpleAdapter simpleAdapter;
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
  
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main); 
              listview = (ListView) findViewById(R.id.listView1);
  
              new SampleAsyncTask().execute();
  
  
          }
  
          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
              // Inflate the menu; this adds items to the action bar if it is present.
              getMenuInflater().inflate(R.menu.activity_main, menu);
              return true;
          }
  
  
  
  
          public class SampleAsyncTask extends AsyncTask&lt;Void, Void, Void&gt; {
  
              @Override
              protected Void doInBackground(Void... params) {
                  try {
                      webRequest();
  
  
                  } catch (Exception e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
                  return null;
              }
  
              @Override
              protected void onPreExecute() {
                  super.onPreExecute();
  
              }
  
              @Override
              protected void onPostExecute(Void result) {
                  super.onPostExecute(result);
  
                  List&lt;Map&lt;String, String&gt;&gt; data = new ArrayList&lt;Map&lt;String, String&gt;&gt;();
  
                  for(int i = 0; i &lt; headersList.size(); i++)
                  {
                      Map&lt;String,String&gt;oglas = new HashMap&lt;String,String&gt;(2);
                      oglas.put("naslov", headersList.get(i));
                      oglas.put("sadrzaj", contentList.get(i));
                      data.add(oglas);
                  }
                  simpleAdapter = new SimpleAdapter(MainActivity.this, data, android.R.layout.simple_list_item_2, from, to);
  
                  listview.setAdapter(simpleAdapter);
              }
  
          }
  
  
  
          private class StableArrayAdapter extends ArrayAdapter&lt;String&gt;{
  
              HashMap&lt;String, Integer&gt; mIdMap = new HashMap&lt;String, Integer&gt;();
  
              public StableArrayAdapter(Context context, int textViewResourceId,
                      List&lt;String&gt; objects) {
                  super(context, textViewResourceId, objects);
                  // TODO Auto-generated constructor stub
                  for (int i = 0; i &lt; objects.size(); ++i) {
                      mIdMap.put(objects.get(i), i);
                  }
              }
  
              @Override
              public long getItemId(int position) {
                  String item = getItem(position);
                  return mIdMap.get(item);
              }
  
              @Override
              public boolean hasStableIds() {
                  return true;
              }
          }
  
  
  
          public void webRequest() throws Exception{
              String servisURL = "http://www.sczg.unizg.hr/student-servis/";
  
              Document doc = Jsoup.connect(servisURL).get();
  
              Elements jobNode = doc.select("div.jobBox");
              Elements headersNode = jobNode.select("h1");
              Elements contentNode = jobNode.select("div.content");
  
  
              for(int i = 0; i &lt; headersNode.size(); i++){
                  headersList.add(headersNode.get(i).text());
              }
  
              for(int i = 0; i &lt; contentNode.size(); i++){
                  contentList.add(contentNode.get(i).text());
              }
  
  
  
          }
  
      }
  </code></pre>