当前位置:网站首页>【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
边栏推荐
- 【HMS core】【FAQ】HMS Toolkit典型问题合集1
- 4. yolov5-6.0 ERROR: AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor' solution
- Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
- 元宇宙改变人类工作模式的四种方式
- Quick Start Tutorial for flyway
- Scrapy爬虫之网站图片爬取
- Re20:读论文 What About the Precedent: An Information-Theoretic Analysis of Common Law
- JCL 学习
- BERT pre-training model series summary
- 【HMS core】【Analytics Kit】【FAQ】如何解决华为分析付费分析中付款金额显示为0的问题?
猜你喜欢

(C language) file operation

Multi-threading scheme to ensure that a single thread opens a transaction and takes effect

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

Meikle Studio - see the actual combat notes of Hongmeng device development 4 - kernel development

Selected System Design | Design of CAN Bus Controller Based on FPGA (with Code)
Container Technology - A Simple Understanding of Kubernetes Objects

A near-perfect Unity full-platform hot update solution

4、yolov5-6.0 ERROR: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘ 解决方案

PyQt5 - draw text on window

Re20:读论文 What About the Precedent: An Information-Theoretic Analysis of Common Law
随机推荐
Js array operating mobile for encapsulation
【C和指针第七章】可变参数列表
梅科尔工作室-看鸿蒙设备开发实战笔记七——网络应用开发
606. Create a string from a binary tree (video explanation!!!)
线程池方式开启线程--submit()和execute()的区别
Basic operations of sequence table in C language
一个近乎完美的 Unity 全平台热更方案
Re17: Read the paper Challenges for Information Extraction from Dialogue in Criminal Law
4、yolov5-6.0 ERROR: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘ 解决方案
By building a sequence table - teach you to calculate time complexity and space complexity (including recursion)
容器技术 -- 简单了解 Kubernetes 的对象
线上靶机prompt.ml
【HMS core】【Analytics Kit】【FAQ】如何解决华为分析付费分析中付款金额显示为0的问题?
MySQL |子查询
Re20:读论文 What About the Precedent: An Information-Theoretic Analysis of Common Law
Re18:读论文 GCI Everything Has a Cause: Leveraging Causal Inference in Legal Text Analysis
Nacos configuration in the project of battle
(文字)无框按钮设置
If someone asks you about distributed transactions again, throw this to him
JVM内存布局、类加载机制及垃圾回收机制详解