The white screen appears because your code runs on the main UI thread. Move heavy tasks to a background thread using AsyncTask, Handler, or coroutines so the UI can load properly.
AsyncTask
Handler