开发者

Loading screen in Android

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 act开发者_如何学Civity?


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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜