I further investigated this.
When app is restarted, created form variables (i.e. AndroidModule2 in above example) are not nil. After calling 'Show' method there is check if FormIndex field is -1. If it is then 'ReInit' method is called, which later calls 'Init', which eventually calls jForm_Create (where this crash occurs).
Problem only manifests if I set jEditText components in the form before 'Show'. If I set jTextView components it all works. Strange.
AndroidModule2.TextView1.Text := 'test'; // this doesn't crash app
AndroidModule2.EditText1.Text := 'test'; // if I do this then app crashes in then following line
AndroidModule2.Show;
I don't know why this happens, but following workaround in code where I create form seems to work for me:
If AndroidModule2 = nil then
begin
gApp.CreateForm(TAndroidModule2, AndroidModule2);
AndroidModule2.Init;
end
else
If AndroidModule2.FormIndex = -1 then
AndroidModule2.ReInit;
Hope this helps someone and if somebody has some better solution please say so.
I attached my test app with AndroidManifest.xml.