Skip to content
This repository was archived by the owner on Aug 9, 2020. It is now read-only.

Commit ade5cd2

Browse files
Merge pull request #45 from Agrimap/2.x
Guard against lazy init of child fragment manager
2 parents a9fd6d2 + fa2b814 commit ade5cd2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

rx_activity_result/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
33
group='com.github.VictorAlbertos'
4-
version='0.4.1-2.x'
4+
version='0.4.4-2.x'
55

66
android {
77
compileSdkVersion 25
@@ -28,3 +28,9 @@ dependencies {
2828

2929
testCompile 'junit:junit:4.12'
3030
}
31+
32+
install {
33+
repositories.mavenInstaller {
34+
pom.artifactId = 'RxActivityResult'
35+
}
36+
}

rx_activity_result/src/main/java/rx_activity_result2/RxActivityResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Fragment getTargetFragment(List<Fragment> fragments) {
161161
for (Fragment fragment : fragments) {
162162
if (fragment != null && fragment.isVisible() && fragment.getClass() == clazz) {
163163
return fragment;
164-
} else if (fragment != null && fragment.getChildFragmentManager() != null) {
164+
} else if (fragment != null && fragment.isAdded() && fragment.getChildFragmentManager() != null) {
165165
List<Fragment> childFragments = fragment.getChildFragmentManager().getFragments();
166166
Fragment candidate = getTargetFragment(childFragments);
167167
if (candidate != null) return candidate;

0 commit comments

Comments
 (0)