title: How to make a LayerDrawable (layer-list item) invisible on Android?
body: <p>I have defined a layer-list with a couple of items on an xml file.
  The items are displayed o.k.
  I want every five second or so one of the layers to become invisible.</p>
  
  <p>It works o.k. for a simple textview for example but not for the Layer inside the LayerDrawable</p>
  
  <pre><code>final private Runnable runnable = new Runnable() {
      public void run() {
          LayerDrawable myDrawable= (LayerDrawable)getResources().getDrawable(R.drawable.all_layers);
          Drawable layer =  myDrawable.findDrawableByLayerId(R.id.interesting_layer);
          if (layer.isVisible()==true)
          {
              layer.setVisible(false, false);
          }
          else
          {
              layer.setVisible(true, false);
          }
          TextView txt = (TextView) findViewById(R.id.txtTest);
          if (txt.getVisibility()==0)
          {
              txt.setVisibility(4);
          }
          else
          {
              txt.setVisibility(0);
          }
          handler.postDelayed(this, 5000);
      }
  };
  </code></pre>
  
  <p>Do I try to get the Id of the layer in a wrong way (I found it from here...)?
  Thanks in advance!</p>