Sunday, April 14, 2013

Re: [android-developers] When to show a dialog from Fragment and when not to

Hi,

You could try using Fragment.isVisible() to determine whether the fragment is visible and can trigger a dialog. For situations where fragment is in the background you could use a Toast perhaps?

--
H

On Apr 14, 2013, at 4:25 PM, William Ferguson <william.ferguson@xandar.com.au> wrote:

> I have a Fragment that fires an async task to connect to a remote server. If it fails to connect (eg times out) then I use use a Handler to display a dialog to the user.
>
> final DialogFragment newFragment = AlertDialogFragment.createConnectionFailedDialog(getSupportActivity());
> newFragment.show(getFragmentManager());

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment