Re: [android-developers] Re: How to show dialog from a Fragment

2011-04-29 Thread Dianne Hackborn
There is an easy way to do this -- call setTargetFragment() on the DialogFragment to tell it who to tell about its result: http://developer.android.com/reference/android/app/Fragment.html#setTargetFragment(android.app.Fragment, int) An ApiDemo using this API is here: http://developer.android.com

Re: [android-developers] Re: How to show dialog from a Fragment

2011-04-29 Thread Mark Murphy
On Fri, Apr 29, 2011 at 5:45 PM, goosedroid wrote: > Can you provide an example of how this scenario would work? Not specifically with a DialogFragment, but passing events between fragments by way the activity is really the only way to do it for *any* fragments. One fragment should neither know n

Re: [android-developers] Re: How to show dialog from a Fragment

2011-04-29 Thread Dianne Hackborn
FragmentDialog is a cleaner and better solution. If you are using fragments, use FragmentDialog. On Fri, Apr 29, 2011 at 5:45 PM, goosedroid wrote: > > > On Apr 29, 1:57 pm, Mark Murphy wrote: > > On Fri, Apr 29, 2011 at 4:52 PM, goosedroid > wrote: > > > Sorry for confusion. My Fragment which

[android-developers] Re: How to show dialog from a Fragment

2011-04-29 Thread goosedroid
On Apr 29, 1:57 pm, Mark Murphy wrote: > On Fri, Apr 29, 2011 at 4:52 PM, goosedroid wrote: > > Sorry for confusion. My Fragment which needs to show the AlertDialog > > also has the actions for that Dialog - so it seems basic that it > > should just create & show the dialog itself. If I were to

Re: [android-developers] Re: How to show dialog from a Fragment

2011-04-29 Thread Mark Murphy
On Fri, Apr 29, 2011 at 4:52 PM, goosedroid wrote: > Sorry for confusion. My Fragment which needs to show the AlertDialog > also has the actions for that Dialog - so it seems basic that it > should just create & show the dialog itself. If I were to break this > into two Fragments, the first needin

[android-developers] Re: How to show dialog from a Fragment

2011-04-29 Thread goosedroid
> > 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/commonsguyhttp: