My problem was solved in the following way:
New Listener:
public class LintListener implements OnTouchListener {
public LintListener() {
// TODO Auto-generated constructor stub
}
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction() ;
//end_game(true);
x_touch = (int) event.getX() ;
y_touch = (int) event.getY() ;
return true;
}
}
And in on Create:
super.onCreate(savedInstanceState);
MySurfaceView msf = new MySurfaceView(this);
setContentView(msf);
msf.setOnTouchListener(new LintListener());