Open jp1017 opened 7 years ago
From: https://github.com/android-cn/android-discuss/issues/324
private long[] mHits = new long[3];// 数组长度表示要点击的次数 //android setting 中点击版本的代码例子 btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1); mHits[mHits.length - 1] = SystemClock.uptimeMillis();// 开机后开始计算的时间(开机时间) if (mHits[0] >= (SystemClock.uptimeMillis() - 500)) { //几次点击的逻辑 } } });
From: https://github.com/android-cn/android-discuss/issues/324