Fabian1648 2 Posted February 20, 2021 Hello, I want to display a "loading in progress" screen while a REST request is retrieving data from a server (execution time: 1.5 seconds with Windows, 6 seconds with Android): On click of a button on the initial form, the app display the "loading in progress" screen and start the REST request. At the end of the REST request, return to the initial form. 1) With windows, if I use the following code: Quote TabControl1.ActiveTab:={tab corresponding to "loading in progress screen"}; {Start REST Request}; The "loading in progress screen" is displayed after the end of the REST request. 2) With windows, if I use the following code: Quote TabControl1.ActiveTab:={tab corresponding to "loading in progress screen"}; tthread.CreateAnonymousThread( procedure begin {Start REST Request} end).start; The "loading in progress screen" is displayed and the REST request start. But on Android, it doesn't work: The REST request runs but the screen "loading in progress screen" is never displayed. How can I proceed to have the right behavior? Thank for your help Share this post Link to post
Remy Lebeau 1394 Posted February 22, 2021 (edited) The 2nd approach is correct - do the REST request in a background thread, leaving the UI thread free to manage the UI. You can update the UI to hide the progress screen when the thread is finished. We can't tell you why the progress screen is not displaying correctly, as you did not show a complete example. Maybe you are still blocking the UI thread in a way that we can't see. Are you able to display the screen if you disable the REST request? Please show a more complete example from start to finish. Edited February 22, 2021 by Remy Lebeau Share this post Link to post