From 2077b5e081bc14290d33727b39735876719b72e2 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 21 Apr 2017 18:56:48 +0200 Subject: [PATCH] android support library bug workaround --- .../nightscout/androidaps/tabs/TabPageAdapter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/tabs/TabPageAdapter.java b/app/src/main/java/info/nightscout/androidaps/tabs/TabPageAdapter.java index cedae6e9d7..4f7b4a7a30 100644 --- a/app/src/main/java/info/nightscout/androidaps/tabs/TabPageAdapter.java +++ b/app/src/main/java/info/nightscout/androidaps/tabs/TabPageAdapter.java @@ -7,6 +7,7 @@ import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; +import android.view.ViewGroup; import java.util.ArrayList; @@ -36,6 +37,15 @@ public class TabPageAdapter extends FragmentStatePagerAdapter { return Fragment.instantiate(context, visibleFragmentList.get(position).getFragmentClass()); } + @Override + public void finishUpdate(ViewGroup container) { + try{ + super.finishUpdate(container); + } catch (NullPointerException nullPointerException){ + System.out.println("Catch the NullPointerException in FragmentStatePagerAdapter.finishUpdate"); + } + } + @Override public CharSequence getPageTitle(int position) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); @@ -58,4 +68,6 @@ public class TabPageAdapter extends FragmentStatePagerAdapter { notifyDataSetChanged(); } } + + }