Acessing Application Lifecycle Interface with AppMethod

185 views Asked by At

I am using the new Embarcadero AppMethod 1.14 to do some development for Android Devices (in C++), but I cannot for the life of me figure out how to gain access to the lifecycle events (doPAuse, doResume, etc). If anyone has any how-to's links, tips or code they can share on this subject?

1

There are 1 answers

0
David Pratt On

Here is the code I finally came up with:

TGUID guid = StringToGUID("{F3AAF11A-1678-4CC6-A5BF-721A24A676FD}");  // GUID for ApplicationEventService interface
IInterface *AEventSvc;
  if (TPlatformServices::Current->SupportsPlatformService(guid)) {
    AEventSvc = TPlatformServices::Current->GetPlatformService(guid);
     IFMXApplicationEventService *EventSvc;
     AEventSvc->QueryInterface(guid,(void**)(&EventSvc));
     EventSvc->SetApplicationEventHandler(SysEventHandler);
     EventSvc->Release();
  }

Kudos out to Pawel Glowaki whose blog gave me the key details to getting this answer: http://blogs.embarcadero.com/pawelglowacki/2013/09/30/40067/