title: ui updating to move background
body: <p>Can I do something like below to update UI. I actually want to move background image or a bitmap like animation.If not please help me with correction.I am new in Android.</p>
  
  <pre><code>float x=0;
  float y=0;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      final ImageView img = (ImageView) findViewById(R.id.img_animation);
  
      new Thread(){
          public void run(){
              runOnUiThread(new Runnable(){
                  public void run() {
  
                      for(;x&lt;=200;)
                      {
                          x++;
                          img.setX(x);
  
  
                          try
                          {
                              sleep(1000);
  
                          }catch(Exception e)
                          {
                              System.out.println("Exception: "+e);
                          }
                      }
                  }
              });
          }
  
  }.start();
  
  }
  </code></pre>