当前位置:网站首页>【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
边栏推荐
- Domino服务器SSL证书安装指南
- (Text) Frameless button settings
- Domino Server SSL Certificate Installation Guide
- If someone asks you about distributed transactions again, throw this to him
- Quick Start Tutorial for flyway
- 一个近乎完美的 Unity 全平台热更方案
- 系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
- 线程池方式开启线程--submit()和execute()的区别
- MFCC转音频,效果不要太逗>V<!
- CVTE校招笔试题+知识点总结
猜你喜欢

A new generation of free open source terminal tool, so cool

Verilog之数码管译码

【HMS core】【FAQ】HMS Toolkit典型问题合集1

在机器人行业的专业人士眼里,机器人行业目前的情况如何?

WARN: Establishing SSL connection without server's identity verification is not recommended when connecting to mysql

shell脚本

Re16:读论文 ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanation

学习笔记11--局部轨迹直接构造法

Re21: Read the paper MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real

百度推广助手遇到重复关键字,验证错误,怎么一键删除多余的
随机推荐
Materialist Dialectics - Conditionalism
论文阅读:SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
606. 根据二叉树创建字符串(视频讲解!!!)
OC-ARC(Automatic Reference Counting)自动引用计数
The thread pool method opens the thread -- the difference between submit() and execute()
Flask之路由(app.route)详解
元宇宙改变人类工作模式的四种方式
OC - Manual Reference Counting Memory Management
spark udf accepts and handles null values.
hcip06 ospf特殊区域综合实验
[100 Solidity Skills] 1. Contract reentrancy attack
Domino服务器SSL证书安装指南
在机器人行业的专业人士眼里,机器人行业目前的情况如何?
STM32CubeMX configuration to generate FreeRTOS project
kubernetes的一些命令
4、yolov5-6.0 ERROR: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘ 解决方案
Re17:读论文 Challenges for Information Extraction from Dialogue in Criminal Law
nacos实战项目中的配置
Online target drone prompt.ml
Mysterious APT Attack