On Fri, Apr 29, 2011 at 3:49 PM, goosedroid <[email protected]> wrote: > I am somewhat confused about the simplest way of showing a Dialog from > a Fragment. From what I can tell, i can call > Fragment.getActivity().showDialog(), and then forward the call from > the containing Activity back to the Fragment via > Activity.onCreateDialog() - but this seems quite messy, since the > Activity now has to know that the Fragment is using Dialogs. > > Is there a better way to do this? To be clear, I have a Fragment that > needs to show an AlertDialog (which does not need to be on any stack), > not a Fragment which needs to /be/ an AlertDialog (like > DialogFragment)
The simplest way of showing a dialog from a Fragment is to use a DialogFragment. I am unclear what you think the difference is between an AlertDialog and an AlertDialog shown by a DialogFragment. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

