in my activity I run code that takes a while to execute, but does not change the UI.
It seems that Android waits for all the code in onCreate to be executed to draw the UI.
Is there any way to force the drawing before executing the long code or I must execute my long lasting code in a thread?
Thanks
You should always create
Threadfor time taking process. Also in some of your scenarios i.e. on low-end device you will face infamousANRdialog