unit Unit11;interfaceuses  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

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android开发 准备工作
  2. android小说阅读源码、bilibili源码、MVP
  3. Android中设置activity的background为Wal
  4. android TextView属性详解
  5. Android(安卓)hardware so加载流程
  6. android 沉浸式主题记录
  7. Android月历控件(DatePicker)和时间控件(Tim
  8. android rom短信模块最后获取的Cursor字
  9. Android控件visible,invisible和gone
  10. Android