Search code examples
androidandroid-canvaspopupwindowandroid-runonuithread

How can I display a view without waiting for the rest of the UI thread to finish?


Basically I have a popup window that I am trying to launch and have open while the rest of my UI loads(it's some canvas calls that take a second or two), but the behavior I'm getting is that the popup window doesn't display until everything has finished running. I'm literally just calling show on the popup window right before the canvas draws. Nothing fancy. How can I make the popup window show up first, so I can obscure the rest of my loading?


Solution

  • If you're drawing for a second or two, you should be doing it on another thread, not the UI thread. Then you notify the UI thread to update again when its done. DO it that way and you'll have a responsive app and it will show the dialog.