title: TextView.post Runnable not always working
body: <p>I have a ListView where Items can be removed by a click on a label. This ListView is in my own Adapter that inherit from BaseAdapter.  After the click on this label I’m calling a method that removes the element from the data array stored in my Adapter.<br>
  Each element contains some Layout stuff and in one Layout a TextView. Sometimes this view should be visible. But i only know if it should be visible, after the Listview ist layoutet! (I’m asking if it is ellipsized)  So i used the post method with a Runnable.</p>
  
  <p>In my <code>getView</code> Method i have the following Runnable statement:</p>
  
  <pre><code>holder.llMyItem.post(new Runnable() {
    @Override
    public void run() {
       if (...) { 
           holder.lblExpand.setVisibility(View.VISIBLE);
       }
     }
  });
  </code></pre>
  
  <p><code>llMyItem</code> is the LinearLayout of the items in the ListView.</p>
  
  <p><code>lblExpand</code> is my TextView that should be visible or not.</p>
  
  <p>The first time my View appears it works fine on Android 4.3. But on Android 2.1 it is not working. </p>
  
  <p>The label only appears after I clicked the “next” button on my view. Just before my Activity finished, my Textview will appear. But that’s too late!
  And there is a second problem:
  After I removed one item in my list with the following method, it will not work after I called <code>notifyDataSetChanged</code>. Just after a touch somewhere on the screen, the runnable starts.</p>
  
  <p>I think the two issues have the same root.</p>
  
  <p>Here is the Code for the method that removes the item (I simplified it)</p>
  
  <pre><code>public void removeListItem(int position) {
     //do some animation stuff
     ArrayList&lt;SomeClass&gt; data = getData();
     data.remove (position);
     notifyDataSetChanged();
  }
  </code></pre>
  
  <p>(The "item removing thing" is working fine)</p>
  
  <p>I tried it with the invalidate Method on the ListView to redraw it. But it still isn't working. The Runnable is not starting after the layout is finished.</p>
  
  <p>Can anybody help me?</p>