Fix NPE in child fragments
This commit is contained in:
parent
a6bffe42d6
commit
7a1bbb1b7a
1 changed files with 7 additions and 5 deletions
|
@ -44,11 +44,13 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
|
||||||
List<Fragment> fragments = getChildFragmentManager().getFragments();
|
List<Fragment> fragments = getChildFragmentManager().getFragments();
|
||||||
for (Fragment fragment : fragments) {
|
if (fragments != null) {
|
||||||
if (fragment instanceof MapMarkersActiveFragment) {
|
for (Fragment fragment : fragments) {
|
||||||
activeFragment = (MapMarkersActiveFragment) fragment;
|
if (fragment instanceof MapMarkersActiveFragment) {
|
||||||
} else if (fragment instanceof MapMarkersHistoryFragment) {
|
activeFragment = (MapMarkersActiveFragment) fragment;
|
||||||
historyFragment = (MapMarkersHistoryFragment) fragment;
|
} else if (fragment instanceof MapMarkersHistoryFragment) {
|
||||||
|
historyFragment = (MapMarkersHistoryFragment) fragment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (activeFragment == null) {
|
if (activeFragment == null) {
|
||||||
|
|
Loading…
Reference in a new issue