If I’d like to launch from my MainActivity an AlertDialog which should be an Activity itself (because I need to pass information from an AlertDialog back to the MainActivity), what is the usual coding concept to do that? Do I have to extend Dialog in my DialogActivity or Activity or something? I’m not sure if the dialog itself should be the Activity or should the Activity somehow invoke an AlertDialog? Can you give me a hint.
My main problem is that I have 3 AlertDialogs in all, the last 2 depend on the choice of the first AlertDialog (so either nr2 or nr3 is called). And I have to pass information from the last dialogs back to the MainActivity, so I think the only clean way is to solve that with different Activities.
[UPDATE]
The solution is to create different Activities, which looks like the dialog (see accepted answer). The next problem was to pass some data from Activity A to B to C and the result back to A. This is very easy with Intents.
A: startActivityForResult(…)
B: startActivity(…); addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
C: setResult(…)
A: get data from onActivityResult(…)
There is a dialog theme that can be used to display an activity like a dialog.
Combined with startActivityForResult() and setResult() you should be able to create what you want.