Fragment#isVisible is returning true even if the user has navigated to 
another Activity. However #isResumed returns false, so maybe that is the 
right target.

On Sunday, April 14, 2013 11:42:06 PM UTC+10, Harri Smått wrote:
>
> 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 
> <[email protected]<javascript:>> 
> 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 [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
--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to