title: Android move background continuously with animation
body: <p>What I want to do is move the background horizontally and have it repeat infinitely.</p>
  
  <p>I tried using an <code>ImageSwitcher</code> with animation to give this effect, but couldn't get it to work right. This is the code I have so farL</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements ViewSwitcher.ViewFactory {
  
      private Animation animSlide;
      private ImageSwitcher image;
      private ImageView imagePop;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          image = (ImageSwitcher) findViewById(R.id.image_switcher);
  
          image.setFactory(this);
          image.setImageResource(R.drawable.zc06);
          Animation in = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
          in.setDuration(10000);
          Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
          out.setDuration(10000);
          image.setInAnimation(in);
          image.setOutAnimation(out);
          Timer timer = new Timer();
          timer.scheduleAtFixedRate(new TimerTask() {
  
              @Override
              public void run() {
                  runOnUiThread(new Runnable() {
                      @Override
                      public void run() {
                          image.setImageResource(R.drawable.zc06);
                      }
                  });
              }
  
          }, 0, 10000);
  
          Animation mZoomInAnimation = AnimationUtils.loadAnimation(this, R.anim.zoom_in);
  
          Animation mZoomOutAnimation = AnimationUtils.loadAnimation(this, R.anim.zoom_out);
          imagePop.startAnimation(mZoomInAnimation);
          imagePop.startAnimation(mZoomOutAnimation);
  
      }
  
      @Override
      public View makeView() {
          ImageView myView = new ImageView(getApplicationContext());
          return myView;
      }
  }
  </code></pre>