What is the proper way of switching between screens in Firemonkey Android app built with Delphi?

  

I’m building Android app in Delphi 10.3 using Firemonkey and I need the app to have 2 different screens – Login and Main. How do I properly organize these, onto Forms, Frames, or some other way? So that Login screen got replaced with Main app screen.

So far I’ve created two forms and tried to toggle them by:

Form1.Hide;
Form2.Show;

but this didn’t work at all, app simply closes itself.

As a workaround, I’ve tried to embed Form2 into Form1. This works, but I’m suspecting this is not the right way to do it:

Form1.GroupBox1.Visible := False; // all elements reside on GroupBox1
Form2.Parent := Form1;
Form2.Show;

Hence the question – How to properly setup and switch between screens in Delphi Firemonkey Android app?

P.S. I’m newbie in Android development and looking for a Delphi-way of solving this case.

Similar questions:

Show login form before main form (implies that Forms should be used, lacks the actual code)

Comments are closed.