WIN DEATH: Window lazarus / 43-Android ---------------------------------------------------------------------- huberte · 2012-04-30 03:14 I have one form, with a button to a second form, nothing special there. the app crashed when I push the button for the second form : http://pastebin.com/izcgKGrV ---------------------------------------------------------------------- felipemdc · 2012-04-30 07:27 Also with the example project lazarus/examples/androidtest/ ? Could you post here your main library project file? Does it contain the clause to create the second form? ---------------------------------------------------------------------- huberte · 2012-04-30 15:07 With my own projetc. Worked with a single form, no I have two. Mainform: Quoteuseless opens unit2 (form3) Quoteuseless  EDIt : dont blame me for the bad programming,  I  guess there is a bettre way to hide button when you click one or another button ---------------------------------------------------------------------- felipemdc · 2012-04-30 15:48 I was asking for the "main library project file", but you have shown the units with the forms. I want to see the one that has "library" written on it. ---------------------------------------------------------------------- huberte · 2012-05-01 04:16 Such a noob sorry Do I really need to write this code for all forms ? Even if I have 100 forms ? ? Quoteprocedure MyActivityOnCreate; begin   DefaultStyle := dsAndroid;   Application.Initialize;   Application.CreateForm(TForm1, Form1);   Application.CreateForm(TForm2, Form2);    Application.CreateForm(TForm2, Form3);   Application.Run; end; ---------------------------------------------------------------------- felipemdc · 2012-05-02 05:46 Quote from: huberte on May 01, 2012, 06:16:53 amDo I really need to write this code for all forms ? Even if I have 100 forms ? ? Yes, for all auto-created forms. In the future the list might be maintained by the IDE, but for now it has to be maintained manually. ---------------------------------------------------------------------- User137 · 2012-05-02 14:29 Quote from: huberte on May 01, 2012, 06:16:53 amDo I really need to write this code for all forms ? Even if I have 100 forms ? ?Only if your forms are all of different type. TForm1, TForm2, ... ,TFormSomething100. But if you have 1 type you can use for-loop, and have variable array if needed. ---------------------------------------------------------------------- huberte · 2012-05-03 02:10 Different type ? I have almost 100 forms in preparation, each one have different button and/or image If I can use something else, could you post the exact syntx  please ? Thks ---------------------------------------------------------------------- User137 · 2012-05-03 09:10 Impossible to give syntax because you haven't given anything specific to describe the problem. What kinds of forms exactly are we dealing with? Can you generate the buttons on the fly? Is it a form that has 1 button and 1 label in a spot that you could just calculate and move, then use 1 form type? TForm1 is a form type. It's the class name in use. edit: Code: [Select]buttonX.caption:=buttonNames[formIndex]; // .. buttonNames could for example be TStringList with each buttons caption. // formIndex could be property on your form, where you know which one you opened.In this case you wouldn't need to actually create all 100 forms in preparation. You can create them on the fly, when needed. Same with image Code: [Select]image1.Picture.LoadFromFile(imageFiles[formIndex]); Code: [Select]myForm:=TMyForm.Create(application); ---------------------------------------------------------------------- Shebuka · 2012-05-03 13:50 An android app with 100 forms? Are you sure you dont have made some huge progect mistakes??? Even calling chaotical a desktop app with 100 forms is a euphemism... ---------------------------------------------------------------------- huberte · 2012-05-03 22:35 lol,  In fact I have a big menu's tree structure. I have about 10 forms with 3 to 10 buttons wich are loading different images (50 to 60) I guess I can load these images in the same form.