FlycoTabLayout icon indicating copy to clipboard operation
FlycoTabLayout copied to clipboard

modify onRestoreInstanceState NullPointerException

Open po1arbear opened this issue 6 years ago • 2 comments

modify NullPointerException in SlidingTabLayout at line 343 "getWidth()" see #333 #384

po1arbear avatar Jan 07 '19 07:01 po1arbear

可惜作者不活跃了

AllenWen avatar Feb 28 '19 07:02 AllenWen

继承父类 @Override protected void onRestoreInstanceState(Parcelable state) { if (state instanceof Bundle) { Bundle bundle = (Bundle) state; int position = bundle.getInt("mCurrentTab"); mLogger.info("tag_count", "" + this.getTabCount() + "position:" + position); if (position >= this.getTabCount()) { mLogger.info("position > tag_count", "重置current为0"); bundle.putInt("mCurrentTab", 0); } } super.onRestoreInstanceState(state); mLogger.info("tag_count", "" + this.getTabCount()); }

zhaozhenqiang avatar May 20 '19 03:05 zhaozhenqiang