问题
I am a little confused about the best way to show pause screen on my android game. will it be better to be a pauseMenuActivity or is it enough with just pauseDialog? this pause dialog will just show score, money, back button, option button , and quit button. if it is better to show dialog, I don't know how to show those buttons and background image.. anyone can help me? thank you
回答1:
I would recommend going for a Dialog (or some other custom overlay). From my experience, inter-Activities transitions aren't always very quick and they can feel kind of sluggish in the context of a game. In my opinion, when I am on a pause screen and want to start playing again, it should be instantaneous.
Plus, an Activity is kind of overkill if you just want to show 4 buttons.
To create a custom dialog containing a custom layout, have a look at the following tutorial and post again if you have specific questions/problems : http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
回答2:
An Activity in general is better than a dialog, because u can take care of all things like orientation, theme etc. and it provides more flexibility. Though in simple cases u can use a dialog.
来源:https://stackoverflow.com/questions/5290333/android-game-pause-screen-dialog-or-activity-dialog