开发者

Use of Dialogs vs Activities

In android development, where a pop-up interaction with a user is required one can use in most situations either a "dialog" or a "activity. Excluding extreme cases where the choice is easy, I would like to know your ideas on which is prefered.

For ex. one might say that on 开发者_如何学Pythonscreen orientation a dialog is lost and the user will have to do the same interaction to get it while an activity stays in place (of course it is "created" again but still stays in its place in the visibility stack).

I would like all possible issues for both cases (performance, side-effects, user interaction issues, etc...).


If you have a less time consuming task and which requires user attention (because you can not access the status bar contents), then you should use dialog, ex, enter the login name and password etc.

Drawbacks of dialog :

  1. You can not handle any configuration change, like orientation, language change etc.
  2. No way to maintain state, like can not navigate to another screen and come back
  3. Performance wise, only thing is dialog is created all the time
  4. Can not access full screen
  5. Won't be able to start it using any intent
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜