Using Delphi's RAD Seattle update 1 when creating a form at runtime, if the main form is with the BorderStyle property other than none I get an error. This problem happens using firemonkey and compiling for Android.
To reproduce the error is simple, just create a firemonkey application, include two forms, do not allow automatic creation, in main form
set BorderStyle
other than none
and call creation of the second form
.
Error Displayed :
android.view.ViewRootImpl$CalledFromWrongThreadException:Only the original thread that created a view hierarchy can touch its views.
Follow the code:
procedure TfrmAgendamento.lstProdutosItemClick(const Sender: TObject;
const AItem: TListViewItem);
begin
if not assigned(frmExpedicao) then
frmExpedicao := tfrmExpedicao.Create(nil);
frmExpedicao.Show;
end;