这是一个初学者的问题。为什么这个方法的布尔返回是一样的?(真假结果相同)
@Override
public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) {
if(pSceneTouchEvent.isActionUp()) {
Log.i("testing", "always happen regardless the boolean return");
}
Log.i("asdf", "i thought this line won't happen if return false");
return false;
}
@Override
public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) {
if(pSceneTouchEvent.isActionUp()) {
Log.i("testing", "always happen regardless the boolean return");
}
Log.i("asdf", "return true, always happen");
return true;
}
请告诉我们有什么区别,或者哪一个是正确的?
对不起英语不好