Loading screen in Android

前端 未结 2 910
悲哀的现实
悲哀的现实 2021-01-22 18:47

What\'s the best way to create a reusable loading screen in Android? The loading screen should have a background image and a loading indicator.

Should I use a separate a

相关标签:
2条回答
  • 2021-01-22 19:35

    The best way is using a separate activity with a SurfaceView that shows the image. Then, you can create an overlay that contains the ProgressBar.

    0 讨论(0)
  • 2021-01-22 19:37

    You just could define your own dialog with custom layout. You would handle what happens if your progress screen gets cancelled (pressing back button). You could also prevent it from happening too.

    By using an standard dialog you take adavantage of nice efects (background activity darkening with upgrades) and prevents user from interacting with background activity while it is on.

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