How to avoid Black Screen on starting an application

前端 未结 1 1585
甜味超标
甜味超标 2021-01-01 23:52

When I start my application initially, I get a black screen which stays for a few seconds before my main activity starts. In case of iphone an image with name default is dis

相关标签:
1条回答
  • 2021-01-02 00:40

    I guess you have a heavy operation on the onCreate method of your "Index" Activity.

    You should put the heavy operations on a thread and make a splash screen with the image, and when the thread is finished, load the menu or whatever you need.

    You can make a "loading screen" for example. It's really easy with Android: https://developer.android.com/guide/appendix/faq/commontasks.html#progressbar or https://developer.android.com/reference/android/widget/ProgressBar.html

    0 讨论(0)
提交回复
热议问题