From c0581aff1d201208c42273b825d573d6cba52900 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Mon, 23 Apr 2012 22:02:32 -0700 Subject: DO NOT MERGE. Do not dispatch context selection events to non-visible fragments. When used in a `ViewPager`, fragments that are present on the adjacent, cached pages will receive context selection dispatches which, depending on your fragment contents, can be difficult to determine whether or not the event truly originated from your view. By using the visible hint we restrict dispatching to only those fragments which are marked as being visible. Since the fragment pager adapter updates this setting properly most implementations will be afforded this fix without any change required. If the user is implementing their own adapter they likely already understand the implications of these cached fragments and the reponsibility for updating the boolean falls to them. Mirrors support library change Ie6a72c1c82c2784774373670007b6f5948fe16da Integrated from AOSP. Change-Id: I19bbbe4c8d910fb38c14d6ae5d462eb7dd44fd26 --- core/java/android/app/FragmentManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/java/android/app/FragmentManager.java') diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index 0519d3e..7e1daa4 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -1890,7 +1890,7 @@ final class FragmentManagerImpl extends FragmentManager { if (mActive != null) { for (int i=0; i