When developing a application for android I need to display a form and collect the results into 2 variables that exist outside of the form which might be used to launch another form. They say I should not use the showmodal method with a procedure anymore. Can somebody give me an example as to how to best handle this now in Firemonkey android. If the user clicks a certain button I need to be able to launch another form after closing the current form. If the user does not click this button the application will return to the previous form. Well in either case the application returns to the previous form.

Comments

  1. Under Delphi Android only one form can be seen at a time. So you just use .Show; Whatever the most recent form you called .Show; on will be the top form. If you have FormA, FormB, and FormC and you started in FormA and then did FormB.Show; and now you want to go to FormC you could call a function in FormA and then FormB.Hide; FormC.Show;. Another way to do that is to use a TTabControl and set the tab type to none and then just use a TFrame in each tab. Now just switch between tabs to display what you want.

    ReplyDelete
  2. Eli M if as a result of some input from that form it is determined that you need to launch another form how would you do that? Launch the form in an event of that form? There is no real way to look at the modal result and launch after the form is closed and before it is destroyed that is since a form does not support showmodal.

    ReplyDelete
  3. If they click a button in FormB just have it call a function in FormA that Show; FormC and Hide FormB. If you need to store a result you can store it in a public variable in FormA. And then access it from FormC when you need it. Every form is effectively a modal form because the user has no way to get back to any other form unless you provide them buttons to do so.

    ReplyDelete

Post a Comment