Delphi XE5 android 捕获几个事件
2014-01-18 14:53
316 查看
unit Unit11; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Layouts, FMX.Memo, FMX.Platform, FMX.StdCtrls; type TForm11 = class(TForm) Memo1: TMemo; ToolBar1: TToolBar; Label1: TLabel; procedure FormCreate(Sender: TObject); private procedure Log(s: string); public function HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; end; var Form11: TForm11; implementation {$R *.fmx} { TForm11 } procedure TForm11.FormCreate(Sender: TObject); var aFMXApplicationEventService: IFMXApplicationEventService; begin if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(aFMXApplicationEventService)) then aFMXApplicationEventService.SetApplicationEventHandler(HandleAppEvent) else Log('Application Event Service is not supported.'); end; function TForm11.HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; begin case AAppEvent of aeFinishedLaunching: Log('Finished Launching'); aeBecameActive: Log('Became Active'); aeWillBecomeInactive: Log('Will Become Inactive'); aeEnteredBackground: Log('Entered Background'); aeWillBecomeForeground: Log('Will Become Foreground'); aeWillTerminate: Log('Will Terminate'); aeLowMemory: Log('Low Memory'); aeTimeChange: Log('Time Change'); aeOpenURL: Log('Open URL'); end; Result := True; end; procedure TForm11.Log(s: string); begin Memo1.Lines.Add(TimeToStr(Now) + ': ' + s); end; end.
View Code
相关文章推荐
- Delphi XE5 android 捕获几个事件
- delphi xe5 android 关于文件大小的几个问答O(∩_∩)O~
- android 事件捕获
- Delphi开发Android的几个注意
- Android上的Back键事件捕获
- android 捕获FocusChange 事件
- android 解决onTouch捕获不了up事件问题
- Android 如何才能捕获系统的恢复出厂设置事件
- Delphi XE5 for Android 启动无黑屏等待总结
- Android按返回键(后退键)Back键事件捕获的两种方法
- Android多点触摸事件捕获
- Android 如何才能捕获系统的恢复出厂设置事件
- Android平台上捕获Back键的事件,Back键是手机上的后退键,一般的软件不捕获相关信息可能导致你的程序被切换到后台,而回到桌面的尴尬情况,在Android上有两种方法来获取该按钮的事件
- Delphi XE5 for Android (三)
- Delphi XE5 for Android (五)
- delphi xe5 android 使用样式(风格)
- Android 如何才能捕获系统的恢复出厂设置事件
- Android上的Back键事件捕获
- Delphi XE5 for Android (十)
- android 安卓 捕获屏幕变黑,变亮,解锁事件