This is the code:
private static Point c;
//c.set(1,1); -> error: "cannot resolve symbol set"??
.
.
.
@Override
public boolean onTouchEvent(MotionEvent event){
switch (event.getAction()){
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
c.set((int)event.getX(),(int)event.getY());
}
return true;
}
When I touch anywhere on the screen the app crashes and I get the following error:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Point.set(int, int)' on a null object reference