int count = 0;
/**系统版本号 listener
*
* 实现连续点击3次以上,跳转到下一个activity
*
* @author elena_wang*/
public OnPreferenceClickListener versionPrefListener = new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference paramPreference) {
// TODO Auto-generated method stub
count++;
if (count == 1) {
start = System.currentTimeMillis();
System.out.println("====start====" + start);
}
if (count == 3) {
end = System.currentTimeMillis();
System.out.println("====end====" + end);
}
if (count >= 3) {
if ((end - start) < 700) {
startActivity(new Intent(SystemMsgActivity.this,SystemVersionAppserver.class));
System.out.println("start intent");
}
System.out.println("====end-start====" + (end - start));
count = 0;
}
if ((System.currentTimeMillis() - start) > 1000) {
count = 0;
start = System.currentTimeMillis();
System.out.println("====超过1000ms=====");
}
return true;
}
};
android 连续点击三次跳转到下一面
最新推荐文章于 2025-06-28 17:01:12 发布