这是代码:
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => false,
'cookies' => false
];
当我触摸屏幕上的任何地方时,应用程序崩溃,我收到以下错误:
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;
}
答案 0 :(得分:0)
Point c
为空,因为您尚未对其进行初始化。要初始化它,你应该写
c = new Point(); // before setting coordinates to c
创建类Point
的新对象。