加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

如何从Delphi禁用Android主页和后退按钮

发布时间:2020-12-15 09:07:12 所属栏目:大数据 来源:网络整理
导读:我正在为Delphi XE7中的 Android平板电脑编写应用程序.我想关掉主页和后退键,这样就没有人可以离开应用程序了.我找到了很多答案,但都没有提到Delphi. 我怎样才能在Delphi中实现这一目标?我应该使用哪些物品?我需要包括哪些单位? 解决方法 从 documentatio
我正在为Delphi XE7中的 Android平板电脑编写应用程序.我想关掉主页和后退键,这样就没有人可以离开应用程序了.我找到了很多答案,但都没有提到Delphi.

我怎样才能在Delphi中实现这一目标?我应该使用哪些物品?我需要包括哪些单位?

解决方法

从 documentation起

Using the Android Device’s Back Button

To make your application handle when users press the Back button on
their Android device,add an event handler to your form for OnKeyUp,
and use the following code within your event handler: In Delphi:

if Key = vkHardwareBack then
begin
  // Do whatever you want to do here
  Key := 0; // Set Key = 0 if you want to prevent the default action
end;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读