title: onTouch giving strange results in getX android
body: <p>I am trying to move a image when you touch on it. I realize that when I was moving the image makes strange things (it sometimes do it well and others move to different places). I made a Log.d with the getX value and this is what I get:</p>
  
  <pre><code> 03-16 19:26:23.569: D/eventX:(15450): 23.0
   03-16 19:26:23.599: D/eventX:(15450): 91.0
   03-16 19:26:23.629: D/eventX:(15450): 20.0
   03-16 19:26:23.659: D/eventX:(15450): 89.0
   03-16 19:26:23.689: D/eventX:(15450): 17.0
   03-16 19:26:23.719: D/eventX:(15450): 87.0
   03-16 19:26:23.749: D/eventX:(15450): 14.0
   03-16 19:26:23.779: D/eventX:(15450): 85.0
   03-16 19:26:23.809: D/eventX:(15450): 11.0
   03-16 19:26:23.839: D/eventX:(15450): 83.0
   03-16 19:26:23.879: D/eventX:(15450): 8.0
  </code></pre>
  
  <p>As you can see one is the good value (the value of the position that I touch it) and other that has no sense. Someone knows the reason why?</p>
  
  <p>Here is the peace of code that I am using...</p>
  
  <pre><code>  head.setOnTouchListener(new View.OnTouchListener() {
  
          @Override
          public boolean onTouch(View arg0, MotionEvent ev) {
              // TODO Auto-generated method stub
              switch (ev.getAction()) {
  
  
              case MotionEvent.ACTION_MOVE: {
                  RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(head.getLayoutParams().width, head.getLayoutParams().height);
                  Log.d("eventX:", ((Float)ev.getX()).toString());
                  layoutParams.leftMargin = (int) ev.getX();
                  head.setLayoutParams(layoutParams);
                  count = false;
  
                  break;
              }
  </code></pre>