NullPointerException of ViewPager when change orientation

In my last exercise of "ViewPager", when change orientation, NullPointerException will be thrown in onSaveInstanceState()!

May be it's a bug in ViewPager. Note the class ViewPager is currently under early design and development. May be it will be fixed in later updates.

At this moment, my solution is to comment the statement to call super.onSaveInstanceState(outState).

 @Override
protected void onSaveInstanceState(Bundle outState) {
//super.onSaveInstanceState(outState);
outState.putInt("tab", getActionBar().getSelectedNavigationIndex());
}


Next:
- Communication between Fragments in ViewPager

thumbnail
Title: NullPointerException of ViewPager when change orientation
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by

Related articles :

0 comments:

Post a Comment

My Blog List

 
Copyright © 2015. About - Web Version - Mobile Version Sitemap - Contact - Privacy