How to move ImageView from specified position?
<p>I've working on a basic game project since 2 days ago and right now I wanna make a level that need to move my balls to specified position , I've 3 balls (I use <code>ImageView</code> for my balls) :</p>

<pre><code>FstBall=(ImageView)findViewById(R.id.FirstBall);
SecBall=(ImageView)findViewById(R.id.SecondBall);
ThdBall=(ImageView)findViewById(R.id.ThirdBall);
</code></pre>

<p>And I used these methods to move my balls , But it doesn't worked , Any Ideas?</p>

<pre><code>@Override
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
int FirstBallX = FstBall.getLeft();
int FirstBallY = FstBall.getTop();
int SecondBallX = SecBall.getLeft();
int SecondBallY = SecBall.getTop();
int ThirdBallX = ThdBall.getLeft();
int ThirdBallY = ThdBall.getTop();
int action = event.getAction();
int x = (int)event.getX();
int y = (int)event.getY();
// Dynamic X and Y :
int FstBaseX= 0;
int FstBaseY= 0;
int SecBaseX= 0;
int SecBaseY= 0;
int ThdBaseX= 0;
int ThdBaseY= 0;
int PrimeyX = 0;
int PrimeryY = 0;
switch (action) {
case MotionEvent.ACTION_DOWN:
if (x &gt; FirstBallX &amp; y &gt; FirstBallY){
FstBaseX = x;
FstBaseY= y;
}else if(x &gt; SecondBallX &amp; y &gt; SecondBallY){
SecBaseX = x;
SecBaseY= y;
}else if(x &gt; ThirdBallX &amp; y &gt; ThirdBallY){
ThdBaseX = x;
ThdBaseY= y;
} else {
// Do Nothing
}
break;
case MotionEvent.ACTION_MOVE:
PrimeyX = x;
PrimeryY = y;
break;
case MotionEvent.ACTION_UP:
if (x &gt; FirstBallX &amp; y &gt; FirstBallY){
int FstFnlResX = FstBaseX + PrimeyX;
int FstFnlResY = FstBaseY + PrimeryY;
FstBall.scrollTo(FstFnlResX, FstFnlResY);
}else if(x &gt; SecondBallX &amp; y &gt; SecondBallY){
int SecFnlResX = SecBaseX + PrimeyX;
int SecFnlResY = SecBaseY + PrimeryY;
SecBall.scrollTo(SecFnlResX, SecFnlResY);
}else if(x &gt; ThirdBallX &amp; y &gt; ThirdBallY){
int ThdFnlResX = ThdBaseX + PrimeyX;
int ThdFnlResY = ThdBaseY + PrimeryY;
ThdBall.scrollTo(ThdFnlResX, ThdFnlResY);
}
break;
}
return true;
}
</code></pre>
