How to open a new Intent inside OnTouch Event?
I have a customized OnTouch Method where i check if the touch coordinates contains a rectangle.After checking the condition i want to start a new Activity.But unfortuanlely its not workin.Can someone help me out? public class custom extends SurfaceView implements SurfaceHolder.Callback{ public boolean onTouchEvent(MotionEvent event) { int touchX = (int) event.getX(); int touchY = (int) event.getY(); switch(event.getAction()){ case MotionEvent.ACTION_DOWN: System.out.println("Touching down!"); for(int i =0; i< rectangles.size();i++){ if(rectangles.get(i).contains(touchX,touchY)){ System.out