Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 screen 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...).

like image 272
dsnz Avatar asked Mar 18 '11 10:03

dsnz


1 Answers

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
like image 110
Karan Avatar answered Oct 15 '22 17:10

Karan