title: how to smoothly move a image- view with users finger on android emulator
body: <p>Every thing is fine in first time when I move <code>ImageView</code> on the screen, but in second time <code>ImageView</code> doesn't move properly.   </p>
  
  <p>This is what I have done so far.</p>
  
  <pre><code>img.setOnTouchListener(new View.OnTouchListener() {
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          // TODO Auto-generated method stub
          int eid = event.getAction();
          switch (eid) {
              case MotionEvent.ACTION_MOVE:
                  FrameLayout.LayoutParams mParams = (FrameLayout.LayoutParams) img.getLayoutParams();
                  int x = (int) event.getRawX();
                  int y = (int) event.getRawY();
                  mParams.leftMargin = x-50;
                  mParams.topMargin = y-50; 
                  img.setLayoutParams(mParams);
                  break;
              case MotionEvent.ACTION_DOWN:
                  x1=img.getX();
                  y1=img.getY(); 
                  break;                         
              case MotionEvent.ACTION_UP:
                  img.setX(x1);
                  img.setY(y1);                          
                  break; 
              default:
                  break;
              }
          return true;
      }
  });
  </code></pre>