[SOLVED] Calling a from from another in LAWM lazarus / 43-Android ---------------------------------------------------------------------- maurobio · 2023-08-14 19:55 Dear ALL, In a test app, I have a main form with just a text edit control and a button. I want that another form (which has just a text view control) be displayed, with the text typed in the first form appearing on its text view. I obviously added code to the click event of the main form button. However, when I click the button, nothing happens! Could someone out there tell me how to do this (ie., calling a form from another in a LAMW app)? My test code is attached. Thanks in advance! With warmest regards, ---------------------------------------------------------------------- Leledumbo · 2023-08-15 05:22 At least I can see that there's no gApp.CreateForm for TAndroidModule2 in controls.lpr. Please check AppDemo1 for multiple forms application and how to switch between them. ---------------------------------------------------------------------- maurobio · 2023-08-15 13:24 Hi, @leledumbo! Thanks for your suggestion. QuoteAt least I can see that there's no gApp.CreateForm for TAndroidModule2 in controls.lpr. It should be as simple as that, but it is not. Including a call to gApp.CreateForm(TAndroidModule2, AndroidModule2) to the project source does not change the behaviour of the app (that is, the second form is not shown). QuotePlease check AppDemo1 for multiple forms application and how to switch between them. I checked, and my very simple test app calls the second form as in the demo but it does not work anyway. I then developed a yet simpler app, again using two forms: 1) The first form has just a jButton with an OnClick event which should show the second form; 2) The second form has just a jWebView component and an OnShow event which should display the Lazarus website. This very simple app does not work either; by clicking the "Show" button on the first form, the second form is not displayed as expected. I attach the code for this second test app. Any further hints? With warmest regards, ---------------------------------------------------------------------- maurobio · 2023-08-15 20:36 Hi, @Leledumbo! I got it! I had just to add an OnActivity event in AndroidModule1: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModule1.AndroidModule1ActivityCreate(Sender: TObject;  intentData: jObject);begin  AndroidModule2.Init(gApp);end; AndroidModule2 now displays fine when I call AndroidModule2.Show! Thanks a lot for your insights! With warmest regards,