Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify onRestoreInstanceState NullPointerException #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

po1arbear
Copy link

@po1arbear po1arbear commented Jan 7, 2019

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

@AllenWen
Copy link

可惜作者不活跃了

@zhaozhenqiang
Copy link

继承父类 @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());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants