标签:
private final int DOUBLE_HINT_NUM = 3;//连击次数
titleRightView.setOnClickListener(new View.OnClickListener() {
long[] mHints = new long[DOUBLE_HINT_NUM];
@Override
public void onClick(View v) {
System.arraycopy(mHints, 1, mHints, 0, mHints.length - 1);
mHints[mHints.length - 1] = SystemClock.uptimeMillis();
if (SystemClock.uptimeMillis() - mHints[0] <= 500) {
// 500ms内三连击则跳转到指定页面
TestHomeActivity.launch(TestActivity.this);
} else {
// ToastUtils.showToastShort("三连击有彩蛋~~~~");
}
}
});
标签:
原文地址:http://www.cnblogs.com/zero-66/p/5968861.html