title: Need image to jump to click location in Android
body: <p>I'm writing a virtual joystick widget that consists of a large circle as the clickable area and a smaller circle representing the actual joystick.  To make manipulation a little easier, I want the user to be able to touch anywhere on the larger circle and the smaller circle will jump to the location of the touch.  If the user drags their finger I want the small circle to follow.  When the small circle is release I want it to jump back to its original position in the center of the large circle.  I'm using a Relative layout with both circles centered horizontally and vertically.</p>
  
  <p>Here's the touch listener I'm using, right now it works mostly as I want, except the smaller circle appears up and to the left of where the touch is.  I can't figure out how to make it snap back to the center when released.</p>
  
  <pre><code> OnTouchListener touchListener = new OnTouchListener() {
          @Override
          public boolean onTouch(View arg0, MotionEvent event)
          {
              // TODO Auto-generated method stub
              status.setText("X: " + event.getX() + ", Y: " + event.getY());
              knob.setX(event.getX());
              knob.setY(event.getY());
              return false;
          }
      };
  </code></pre>