title: animating a view in Android
body: <p>I’d like to do something very basic, for having a kind of animation. So a loop like: </p>
  
  <ul>
  <li>Update bitmap</li>
  <li>Sleep 100ms </li>
  <li>Display bitmap "mabm" on a view</li>
  </ul>
  
  <p>My code works only once, performing the first loop, and I can’t afford to find a solution for the others loops.
  What is the simplest way to do that?
  Thank you for your help!</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>Bitmap mabm= Bitmap.createBitmap(400,400,Bitmap.Config.ARGB_8888);
  final Drawable d =new BitmapDrawable(mabm);
  
  /* more code here */
  
  Taff=new Thread(new Runnable() { 
  
      // voir : android updating a view repeatedly
  
      @Override   
      public void run(){                                  
          try {
              Thread.sleep(100);
          } catch (InterruptedException e) {
              //empty catch
          }
  
         deco.decompp() ;  // this method updates mabm        
  
         runOnUiThread(new Runnable() {
             @Override
             public void run() {
                 //Drawable d =new BitmapDrawable(mabm);
                 ds.setBackgroundDrawable(d); 
             }                            
         }); 
      }
  );
  </code></pre>