title: Move an Image continously in Random position within the display in android
body: <p>Can anyone help me to do this.
  I am trying to build an android app but stuck in between.</p>
  
  <p>i have use the following code to move a image.
  iv is ImageView object</p>
  
  <pre><code>moveImage = new TranslateAnimation( 0, xDest, 0, -yDest);
  moveImage.setDuration(1000);
  moveImage.setFillAfter( true );
  iv.startAnimation(moveImage);
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>public class gameLogic extends Activity 
  {
  ImageView image;
  TranslateAnimation moveImage;
  
  public void onCreate(Bundle icicle) 
  {
      super.onCreate(icicle);
      setContentView(R.layout.game_logic);
      imageMoveRandom(imageList(image,0));
  }
  
  ImageView imageList(ImageView v,int i)
  {
      v = (ImageView) findViewById(R.id.rabbit);
      int imgId;
      int j = i;
  
      TypedArray imgs = getResources().obtainTypedArray(R.array.random_imgs);
      //get resourceid by index
  
      imgId = imgs.getResourceId(j, 0);
      // or set you ImageView's resource to the id
      v.setBackgroundResource(imgId);
  
      return v;
  
  }
  
  void imageMoveRandom(ImageView iv)throws NotFoundException
  {
      DisplayMetrics dm = new DisplayMetrics();
      this.getWindowManager().getDefaultDisplay().getMetrics( dm );
  
      int xDest = dm.widthPixels/2;
      int yDest = dm.heightPixels/2;
  
  //      Toast.makeText(gameLogic.this, dm.widthPixels, Toast.LENGTH_SHORT).show();
          //      Toast.makeText(this, dm.heightPixels, 2000).show();
  
  
          moveImage = new TranslateAnimation( 0, xDest, 0, -yDest);
          moveImage.setDuration(1000);
          moveImage.setFillAfter( true );
          iv.startAnimation(moveImage);
          //moveImage.reset();
      }
  }
  </code></pre>
  
  <p>Above is not full code..but part which may be helpful for references.</p>
  
  <p>But i want to continuously move the image in random place but within the android display.
  Can any one suggest the solution.</p>
  
  <p>Thanks in Advance :)</p>