event.getAction()&MotionEvent.ACTION_MASK的原因

看到下面代码中用了AND位运算是为了什么呢? public boolean onTouchEvent(MotionEvent event) { int action = event.getAction(); switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: showMsg("ACTION_DOWN" + action); break;……

Android ViewHolder模式

这个ViewHolder到底是什么呢?我们可以在官方sample看到这段代码 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html static class ViewHolder……