public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
//some code....
break;
case MotionEvent.ACTION_UP:
v.performClick();//這邊必須補上 否則會有此警告
break;
default:
break;
}
return true;
}
參考答案:http://stackoverflow.com/questions/24952312/ontouchlistener-warning-ontouch-should-call-viewperformclick-when-a-click-is-d
沒有留言:
張貼留言