当前位置:网站首页>【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
边栏推荐
- EViews 12.0 software installation package download and installation tutorial
- OC-ARC(Automatic Reference Counting)自动引用计数
- 软考 系统架构设计师 简明教程 | 案例分析 | 需求分析
- 梅科尔工作室-看鸿蒙设备开发实战笔记五——驱动子系统开发
- shell脚本
- 百度推广助手遇到重复关键字,验证错误,怎么一键删除多余的
- 这种叫什么手法
- (***Key points***) Flink common memory problems and tuning guide (1)
- 2022年顶会accepted papers list
- (BUG record) No module named PIL
猜你喜欢

百度推广助手遇到重复关键字,验证错误,怎么一键删除多余的

Quick Start Tutorial for flyway

Baidu promotion assistant encounters duplicate keywords, verification errors, how to delete redundant ones with one click

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

(Text) Frameless button settings
![idea2021+Activiti [the most complete note one (basic use)]](/img/60/55cccf257523bed2c8829361cea97c.png)
idea2021+Activiti [the most complete note one (basic use)]

Redis Desktop Manager 2022.4.2 released

一个近乎完美的 Unity 全平台热更方案
![[Qualcomm][Network] 网络拨号失败和netmgrd服务分析](/img/76/49054ff8c7215eca98cc479ab1d986.png)
[Qualcomm][Network] 网络拨号失败和netmgrd服务分析

学习笔记11--局部轨迹直接构造法
随机推荐
Basemap and Seaborn
The thread pool method opens the thread -- the difference between submit() and execute()
论文阅读:SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
(BUG record) No module named PIL
idea2021+Activiti【最完整笔记一(基础使用)】
Security思想项目总结
Re15: Read the paper LEVEN: A Large-Scale Chinese Legal Event Detection Dataset
新一代开源免费的终端工具,太酷了
spark udf accepts and handles null values.
第3章 信息收集
Container Technology - A Simple Understanding of Kubernetes Objects
GNOME 新功能:安全启动被禁用时警告用户
If someone asks you about distributed transactions again, throw this to him
Meikle Studio-Look at the actual combat notes of Hongmeng device development six-wireless networking development
死锁的理解
系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
Meikle Studio-Look at Hongmeng Device Development Practical Notes 7-Network Application Development
Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
梅科尔工作室-看鸿蒙设备开发实战笔记六—无线联网开发
A near-perfect Unity full-platform hot update solution