代码实现:
long[] mHits = new long[点击次数];//定义为成员变量
System.arraycopy(mHits, 1,
mHits, 0, mHits.length - 1); //相当于将数组向左平移1
mHits[mHits.length - 1] =
SystemClock.uptimeMillis();//SystemClock.uptimeMillis()手机开机时算起的毫秒值
if
(mHits[0] >= (SystemClock.uptimeMillis() - 500)) {
//多次点击要实现的功能
}
Copies length elements from the
array src, starting at offset srcPos, into
the array dst, starting at
offset dstPos.
The source and destination arrays can be the same array, in which case copying is performed as if the source elements are first copied into a temporary array and then into the destination array.
src. 源数组内容的起始位置 dst. 目标数组的起始位置 原文:http://www.cnblogs.com/ff0o0/p/3512729.html