title: OnTouchListener,the code jump and, method doesnt run
body: <p>I have a simple code, just i dont understand why my method
  calculaCoordenadasImagen(MotionEvent e) doesnt work</p>
  
  <p>Chech the logs inside this Listener for understand what works and what dont</p>
  
  <p>first the Listener which call that method</p>
  
  <pre><code>View.OnTouchListener clickPinta = new View.OnTouchListener() {
      @Override
      public boolean onTouch(View v, MotionEvent event) {
          Log.i("clickPinta","onTouch");
          if(event.getAction()==MotionEvent.ACTION_UP){
              Log.i("ClickPint","ACTION_UP");//this log works
              calculaCoordenadasImagen(event);//this method is not executed
              Log.i("onToucn" ,"pasa calculaCoord");//this log works
              guardaCoordenadas(lastTouchX,lastTouchY);
              return true;
          }
          return false;
      }
  };
  </code></pre>
  
  <p>//this is the method which doesn't run and i cant understand why.</p>
  
  <pre><code>void calculaCoordenadasImagen(MotionEvent e){
      Log.i("calculaCoordenadas","");//this log dont works
      float []m = new float[9];
      matrix.getValues(m);
      float transX = m[Matrix.MTRANS_X] * -1;
      float transY = m[Matrix.MTRANS_Y] * -1;
      float scaleX = m[Matrix.MSCALE_X];
      float scaleY = m[Matrix.MSCALE_Y];
      lastTouchX = (int) ((e.getX() + transX) / scaleX);
      lastTouchY = (int) ((e.getY() + transY) / scaleY);
      lastTouchX = Math.abs(lastTouchX);
      lastTouchY = Math.abs(lastTouchY);
  }
  </code></pre>
  
  <p>this is the method who have the error but because the previous method doesnt run:</p>
  
  <pre><code>void guardaCoordenadas(int x, int y){
      Log.i("guardaCoordenadas","");
      Marking m = new Marking(x,y);
      listaPtos.add(m);
      Log.i("listaPtos0",""+m.x+"-"+m.y);
  }
  </code></pre>
  
  <p>and there are first lines about the logCat-error:</p>
  
  <pre><code>10-28 09:57:45.683: I/clickPinta(28066): onTouch
  10-28 09:57:45.688: I/clickPinta(28066): onTouch
  10-28 09:57:45.688: I/ClickPint(28066): ACTION_UP
  10-28 09:57:45.688: I/onToucn(28066): pasa calculaCoord
  10-28 09:57:45.688: E/InputEventReceiver(28066): Exception dispatching input event.
  10-28 09:57:45.693: E/MessageQueue-JNI(28066): Exception in MessageQueue callback: handleReceiveCallback
  10-28 09:57:45.713: E/MessageQueue-JNI(28066): java.lang.NullPointerException
  10-28 09:57:45.713: E/MessageQueue-JNI(28066):  at com.andres.sun4all.Imagen.guardaCoordenadas(Imagen.java:291)
  10-28 09:57:45.713: E/MessageQueue-JNI(28066):  at com.andres.sun4all.Imagen$2.onTouch(Imagen.java:165)
  10-28 09:57:45.713: E/MessageQueue-JNI(28066):  at android.view.View.dispatchTouchEvent(View.java:7332)
  10-28 09:57:45.713: E/MessageQueue-JNI(28066):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2416)
  10-28 09:57:45.713: E/MessageQueue-JNI(28066):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2159)
  10-28 09:57:45.713: E/MessageQueue-JNI(28066):  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2416)
  </code></pre>
  
  <p>I guess the problem is silly, but well, i cant find it</p>
  
  <p>Thanks for your help and your time</p>