Lazarus

Programming => Operating Systems => Android => Topic started by: Robert Gilland on June 18, 2021, 03:13:36 am

Title: Recyclable jForm Create and Init sequence has changed and broken my App
Post by: Robert Gilland on June 18, 2021, 03:13:36 am
Hi,
 
  Recyclable jForm Create and Init sequence has changed and broken my App. I don't know when this change happened but with the latest
LAMW from GIT my application crashes. It was working perfectly. I have tried all sorts of ways to get my App to not crash and no luck.

  How am I meant to Create and Init Recyclable jForms in LAMW App?

  I create Recyclable jForms as below:

procedure EditStockTakeItems(  pCallingForm : jForm; poDocument : TDocumentTransferObj; pOnCloseCallback : TNotifyEvent );
begin
  if frmStockTakeItems = nil then
    begin
      gApp.CreateForm(TfrmStockTakeItems, frmStockTakeItems);
      frmStockTakeItems.pCallingForm := pCallingForm;
      frmStockTakeItems.poDocument := poDocument;
      frmStockTakeItems.Init(gApp);
    end
  else
    begin
      frmStockTakeItems.pCallingForm := pCallingForm;
      frmStockTakeItems.poDocument := poDocument;
      frmStockTakeItems.Show;
    end;
  frmStockTakeItems.SetCloseCallBack(pOnCloseCallback, pCallingForm );
end;

Title: Re: Recyclable jForm Create and Init sequence has changed and broken my App
Post by: schumi on June 18, 2021, 05:24:18 pm
hi,
look AppDemo1 in demos\GUI or move createform / init code in OnActivityCreate method

Title: Re: Recyclable jForm Create and Init sequence has changed and broken my App
Post by: Mongkey on June 19, 2021, 03:24:24 am
This thread is a good start solving your problem:

https://forum.lazarus.freepascal.org/index.php/topic,54916.0.html

 :)
TinyPortal © 2005-2018