当前位置:网站首页>【HarmonyOS】【ARK UI】HarmonyOS ets语言怎么实现双击返回键退出
【HarmonyOS】【ARK UI】HarmonyOS ets语言怎么实现双击返回键退出
2022-07-30 09:56:00 【51CTO】
参考资料
【Harmony OS】【ARK UI】Date 基本操作
弹窗
代码运行
思路:
定义一个全局变量,判断点击时间与上一次点击时间差,若大于2秒则提示‘再按一次退出程序’字样,小于2秒退出应用,代码如下

运行效果

欲了解更多更全技术文章,欢迎访问 https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh
边栏推荐
- Re18:读论文 GCI Everything Has a Cause: Leveraging Causal Inference in Legal Text Analysis
- 软考 系统架构设计师 简明教程 | 案例分析 | 需求分析
- JCL learning
- Meikle Studio - see the actual combat notes of Hongmeng equipment development five - drive subsystem development
- Detailed explanation of JVM memory layout, class loading mechanism and garbage collection mechanism
- (C language) file operation
- Container Technology - A Simple Understanding of Kubernetes Objects
- 时刻铭记:总有一天你将破蛹而出
- 系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
- hcip06 ospf特殊区域综合实验
猜你喜欢

spark udf accepts and handles null values.

Flask之路由(app.route)详解

Meikle Studio-Look at Hongmeng Device Development Practical Notes 7-Network Application Development

Domino Server SSL Certificate Installation Guide

图像去噪——Neighbor2Neighbor: Self-Supervised Denoising from Single Noisy Images

flyway的快速入门教程

Study Notes 11--Direct Construction of Local Trajectories

Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory

hcip06 ospf special area comprehensive experiment

Quick Start Tutorial for flyway
随机推荐
New in GNOME: Warn users when Secure Boot is disabled
线程池方式开启线程--submit()和execute()的区别
Re17: Read the paper Challenges for Information Extraction from Dialogue in Criminal Law
Soft test system architects introductory tutorial | system operation and software maintenance
PyQt5 - Drawing different types of straight lines
spark udf 接受并处理 null值.
自适应控制——仿真实验一 用李雅普诺夫稳定性理论设计自适应规律
idea2021+Activiti [the most complete note one (basic use)]
MFCC to audio, the effect should not be too funny >V
Re21: Read the paper MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real
第1章 Kali与靶机系统
what is this method called
Flink_CDC搭建及简单使用
Re19: Read the paper Paragraph-level Rationale Extraction through Regularization: A case study on European Court
死锁的理解
Quick Start Tutorial for flyway
debian10安装djando
第2章 常用安全工具
软考 系统架构设计师 简明教程 | 系统运行与软件维护
容器技术 -- 简单了解 Kubernetes 的对象