当前位置:网站首页>【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
边栏推荐
- OC-手动引用计数内存管理
- 多线程--线程和线程池的用法
- Four ways the Metaverse is changing the way humans work
- Re21:读论文 MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real
- mysql安装教程【安装版】
- In 2022, the top will be accepted cca shut the list
- 北京突然宣布,元宇宙重大消息
- Re15: Read the paper LEVEN: A Large-Scale Chinese Legal Event Detection Dataset
- Basemap和Seaborn
- Mysterious APT Attack
猜你喜欢

通过构建一个顺序表——教你计算时间复杂度和空间复杂度(含递归)

Understanding of deadlock

Re20:读论文的先例:普通法的信息理论分析

Nacos configuration in the project of battle

Re19: Read the paper Paragraph-level Rationale Extraction through Regularization: A case study on European Court

Meikle Studio-Look at the actual combat notes of Hongmeng device development six-wireless networking development

BERT预训练模型系列总结

idea2021+Activiti【最完整笔记一(基础使用)】

Paper reading: SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers

多线程保证单个线程开启事务并生效的方案
随机推荐
Day113.尚医通:微信登录二维码、登录回调接口
线上靶机prompt.ml
flowable workflow all business concepts
Meikle Studio-Look at Hongmeng Device Development Practical Notes 7-Network Application Development
[100 Solidity Skills] 1. Contract reentrancy attack
Meikle Studio - see the actual combat notes of Hongmeng equipment development five - drive subsystem development
通过构建一个顺序表——教你计算时间复杂度和空间复杂度(含递归)
软考 系统架构设计师 简明教程 | 案例分析 | 需求分析
第3章 信息收集
Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
JCL 学习
A new generation of free open source terminal tool, so cool
Redis Desktop Manager 2022.4.2 发布
Flink_CDC搭建及简单使用
In 2022, the top will be accepted cca shut the list
Basemap和Seaborn
Baidu promotion assistant encounters duplicate keywords, verification errors, how to delete redundant ones with one click
多线程--线程和线程池的用法
ospf2 two-point two-way republish (question 2)
[Qualcomm][Network] 网络拨号失败和netmgrd服务分析