抄的大牛写的代码
final long[] mHits = new long[2];// 数组长度表示要点击的次数 iv_moveimg.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1); mHits[mHits.length - 1] = SystemClock.uptimeMillis();// 开机后开始计算的时间 if (mHits[0] >= (SystemClock.uptimeMillis() - 500)) { //执行双击 } } });