title: Android listview item doesn't appear
body: <p>I should write in the title instead of 'doesn't work' something like 'I
  don't know how to do it' but the first version feels better :).
  What I am trying to do is the following:</p>
  
  <ol>
  <li>Download the xml from the web, parse it and create ArrayList of some
  objects (done and working)</li>
  <li>Display the objects using custom Adapter (doesn't work)</li>
  </ol>
  
  <p>The second one works if I add the items to my ArrayList before I add it to
  the view using</p>
  
  <pre><code>m_orderAdapter = new OrderAdapter(this,m_orders); //code for orderadapter
  below
  setListAdapter(m_orderAdapter);
  </code></pre>
  
  <p>I have found on the web something like this: (in my onCreate method)</p>
  
  <pre><code>handler = new Handler();
          viewOrders = new Runnable(){
  
              @Override
              public void run() {
                  getOrders();
  
              }
  
          };
          new Thread(){
              @Override
              public void run(){
                  handler.post(viewOrders);
              }
          }.start();
  </code></pre>
  
  <p>then, the following code for the methods:</p>
  
  <pre><code>private void getOrders(){
        try{
            OrderManager om = new OrderManager();
             m_orders = om.getOrdersFromWeb();
             Log.i("ARRAY", ""+ m_orders.size());
        } catch (Exception e) {
            Log.e("BACKGROUND_PROC", e.getMessage());
        }
        runOnUiThread(returnRes);
      }
  </code></pre>
  
  <p>OrderManager downloads and parse the xml into Order objects and returns
  array list of those. Then I set this list to my member array list m_orders.
  Once downloading and parsing is done I run returnRes method on the ui thread
  using <code>runOnUiThread</code> method</p>
  
  <pre><code>private Runnable returnRes = new Runnable() {
  
          @Override
          public void run() {
              if(m_orders != null &amp;&amp; m_orders.size() &gt; 0){
                  Log.i("ORDER",m_orders.get(0).getOrder_id());
                  setListAdapter(m_orderAdapter);
                  m_orderAdapter.notifyDataSetChanged();
              }
            m_orderAdapter.notifyDataSetChanged();
          }
        };
  </code></pre>
  
  <p>and I call notifyDataSetChanged() on my adapter.</p>
  
  <p>The view I do all this stuff extends ListView and the code for the adapter
  itself is listed below:</p>
  
  <pre><code>public class OrderAdapter extends BaseAdapter{
  
      private Context ctx;
      private List&lt;Order&gt; orders;
  
      public OrderAdapter(Context ctx, List&lt;Order&gt; orderLst){
          this.ctx = ctx;
          this.orders = orderLst;
      }
      @Override
      public int getCount() {
          return orders.size();
      }
  
      @Override
      public Object getItem(int pos) {
          return orders.get(pos);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          Order o = orders.get(position);
          return new OrderListAdapterView(this.ctx,o);
      }
  
  }
  </code></pre>
  
  <p>When I debug I have the data inside my m_orders list but when I call
  notifyDataSetChanged nothing happens, I've read that I have to execute that
  on the UI thread which I think I do. So whats the problem ?
  any help highly appreciated, or maybe just a link to the nice tutorial on
  the web explaining this issue on how to update the list view at runtime ?</p>