AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

[Fmx] App crasht OnScreenRotation

Ein Thema von Rollo62 · begonnen am 18. Feb 2016 · letzter Beitrag vom 18. Feb 2016
 
Rollo62

Registriert seit: 15. Mär 2007
4.164 Beiträge
 
Delphi 12 Athens
 
#6

AW: [Fmx] App crasht OnScreenRotation

  Alt 18. Feb 2016, 14:04
Also ich habe mittlerweile das Demo immer weiter abgespeckt:
- TabControls raus - crash
- Panels raus - crash
- Stylebook raus - crash
- DataModule raus - crash
- alle uses die unbenutzt sind raus -crash

Natürlich immer alle DCUs etc gelöcht, das ganze Android Verzeichnis - crash

Das macht mir langsam Angst
Ich habe jetzt nur noch die Form it einem Memo das die AppEvents und ScreenOrientation zeigt - crash

Hab die abgespeckte Demo nochmal im Anhang T81_....

Delphi-Quellcode:
unit UMain_Frm;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes
  , FMX.Forms
// , System.Variants
// FMX.Types, FMX.Controls, FMX.Forms, FMX.StdCtrls,
// FMX.Layouts, FMX.Objects, FMX.ImgList,
// FMX.Controls.Presentation
  , FMX.Platform
// , FMX.ScrollBox
  , FMX.Memo
  , System.Messaging, FMX.Types, FMX.Controls, FMX.Controls.Presentation,
  FMX.ScrollBox
  ;

type
  TMain_Frm = class(TForm)
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    FOrientationChangedId: Integer;
    { Private declarations }

    procedure EvOnOrientationChanged(const Sender: TObject; const Msg: TMessage);
    function EvOnAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean;

    procedure Log(const ALog : String);

  public
    { Public declarations }
  end;

var
  Main_Frm: TMain_Frm;

implementation

{$R *.fmx}

procedure TMain_Frm.FormCreate(Sender: TObject);
var
  aFMXApplicationEventService: IFMXApplicationEventService;
begin

  if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(aFMXApplicationEventService)) then
    aFMXApplicationEventService.SetApplicationEventHandler(EvOnAppEvent)
  else
    Log('Application Event Service is not supported.');


  //Subscribe to orientation change events in OnCreate or similar
  FOrientationChangedId := TMessageManager.DefaultManager.SubscribeToMessage(
       TOrientationChangedMessage, EvOnOrientationChanged);


end;





procedure TMain_Frm.FormDestroy(Sender: TObject);
begin
  //Unsubscribe from orientation change events in OnDestroy or similar
  TMessageManager.DefaultManager.Unsubscribe(TOrientationChangedMessage, FOrientationChangedId);
end;

procedure TMain_Frm.Log(const ALog: String);
begin
  Memo1.Lines.Insert(0, ALog);

end;


procedure TMain_Frm.EvOnOrientationChanged(const Sender: TObject; const Msg: TMessage);
begin
  Log('Orientation changed: ' + Msg.ToString);
end;


function TMain_Frm.EvOnAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean;
begin

  case AAppEvent of
    TApplicationEvent.FinishedLaunching: Log('Finished Launching');
    TApplicationEvent.BecameActive: Log('Became Active');
    TApplicationEvent.WillBecomeInactive: Log('Will Become Inactive');
    TApplicationEvent.EnteredBackground: Log('Entered Background');
    TApplicationEvent.WillBecomeForeground: Log('Will Become Foreground');
    TApplicationEvent.WillTerminate: Log('Will Terminate');
    TApplicationEvent.LowMemory: Log('AppEvent: Low Memory');
    TApplicationEvent.TimeChange: Log('AppEvent: Time Change');
    TApplicationEvent.OpenURL: Log('AppEvent: Open URL');
    else
                                            Log('AppEvent: Unknown');
  end;
  Result := True;
end;

end.
Angehängte Dateien
Dateityp: zip T81_ScreenOrientCrash.zip (356,2 KB, 3x aufgerufen)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz