android support library bug workaround
This commit is contained in:
parent
55a2df470e
commit
2077b5e081
1 changed files with 12 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue