I have a method that takes a while to execute, and i need it at the start of my activity. If i put it in the onCreate method it will slow down the actual loading of the activity. Is there a way to listen for onCreate to be done, and then call the method so the user does not have a blank screen while the laborsome method is running.
Share
If the method you are calling takes a while to execute then no matter where in the activity lifecycle you execute it, it will cause a disruption to the user experience (a “frozen” screen). Maybe you could instead disable the UI, perhaps put up a loading spinner and do the work in an
AsyncTask. You can hide the spinner and re-enable the rest of the UI after the work is done.