In my Android application, it takes more than 10 seconds to load (it contains several text elements with long text values), now I want to show the progress bar dialog box while Activity is loading? Can I use "AsyncTask"? if possible, how can I pause the user interface thread until AsyncTask is complete. When I try to show a dialog before calling setContentView (), I get an error, for example android.view.WindowManager $ BadTokenException: cannot add a window - the null token is not for the application
source share