在listView 或者 gridView 的使用中,通常不仅仅为了展现数据,更多的是操作数据。于是当控件重合在一起时,我们需要添加事件。就会出现一个问题,当点击一个控件和长按这个控件时,常常出现长按控件会影响点击事件,也就是长按了控件,那么自动会带上点击事件的效果。纠结了下,发现原来是长按时,应该返回 true。aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAABRCAIAAAAcimw6AAAgAElEQVR4nO26Wbfr1nXnuwCi7wECIAASIEESAEGARA+SYM/dN+ecfRqdTkdbsixFdiy5SeKMuMqxK5btuCsrtu8oyXIURbYUW7GdpOrlJvUJUnnM18jw/Qz34RzZaezKzstN3Sr/x3rYY+xNED/MOdf8Y+4F/p//kwT+vW/g/1P9mvZ/Xz2h/b//+r8/9eDy1v3nHjzz4uXli5fPvPjg6efuP/PCo+devHv3mYuLexc3713cvnfn7tOPHn34/tPP3nn4aHt2/ezWg4PzO7PtUb7c5cvdbP/o5M7dy+devLx88fJDv1gPP/ShG/fuHVxc7M4vdocXu5OLvWu3jm/cO7354M7D58/vPn39/qOLh5fXbt8/PL/YnV7fHZ7unV4cX784uXZxfH6xd3S6Ozo5vX33zqPnH16++OiZD9998MzNu/cvbt+7uHiyzq7dvvXUgz/74ftXov2r//rf1vuni73z3fGtg6NbB4c3d4fnu+Pz4/OLze64mu+q+W4631Wbw6Ozi72Ds9X+4SDJ4mozKpftQaT3fL3vt4dRstjun948PLl1cnrr9OzW6dmt0/NbB+fXpuvtqKj8tPLjyk8rv6jC2TKpdtXeab7en+yOqv2jcrEe55WXTJxROoyLuJzFRRUWlR9lfpxky83q6PrBya2jkxvbw5PV9nC22BbFqsiXeblMJ9V0s/nuW29difYv/uq/LXani93p7vD67uD67uDabu90d3C6f3i+2h5Wy101301mu8n68Ojaxd7e2Wp7GKRZUFaj2bwXRqbjN12/HUbxfL09vLY7uL7/+Ap7p7v90/X+UT5fB1nlJ1MvLpy49PNqOK3iajXd7mfL3WSzX233ymo1zqZelPfCxI/TMJ+FxczPSmeceuMkm29W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37a9pfql/T/i+tX9P+mvaX6te0/0vrV9JeUf//pv3Upz71t3/7t//javq7v/u73/3d333llVf+5m/+5t8X44r6fwGDr6nDqjm6wQAAAABJRU5ErkJggg==" alt="" />
如下代码所示:
holder.playBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int index = holder.getLayoutPosition();
// Toast.makeText(context, "position=" + bean.getLocationPath(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(bean.getLocationPath()), "video/mp4");
context.startActivity(intent);
}
});
holder.playBtn.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
Toast.makeText(context, "position=" + bean.getLocationPath(), Toast.LENGTH_SHORT).show();
return false;
}
});
写出来避免自己错误重犯