Program: 14444
Project: 14444
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_subs);
  restoreState(savedInstanceState);
  mViewPager=(ViewPager)findViewById(R.id.viewpager);
  mViewPager.setAdapter(getPageAdapter());
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  PagerTabStrip tabStrip=(PagerTabStrip)findViewById(R.id.pager_tabs);
  tabStrip.setTabIndicatorColorResource(R.color.tab_indicator);
  tabStrip.setTextColor(getResources().getColor(R.color.tab_text_selected));
  mEditAdd=(EditText)findViewById(R.id.edit_add);
  mEditAdd.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView v,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_DONE) {
        addCurrentEntry();
      }
      return false;
    }
  }
);
  mBtnAdd=(ImageButton)findViewById(R.id.btn_add);
  mBtnAdd.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      addCurrentEntry();
    }
  }
);
  if (savedInstanceState == null) {
    restorePreviousPage();
  }
  mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
    @Override public void onPageSelected(    int position){
      String pageTitle=(String)getPageAdapter().getPageTitle(position);
      AppPrefs.setReaderSubsPageTitle(pageTitle);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_subs);
  restoreState(savedInstanceState);
  mViewPager=(ViewPager)findViewById(R.id.viewpager);
  mViewPager.setAdapter(getPageAdapter());
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  toolbar.setNavigationOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      onBackPressed();
    }
  }
);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  PagerTabStrip tabStrip=(PagerTabStrip)findViewById(R.id.pager_tabs);
  tabStrip.setTabIndicatorColorResource(R.color.tab_indicator);
  tabStrip.setTextColor(getResources().getColor(R.color.tab_text_selected));
  mEditAdd=(EditText)findViewById(R.id.edit_add);
  mEditAdd.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView v,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_DONE) {
        addCurrentEntry();
      }
      return false;
    }
  }
);
  mBtnAdd=(ImageButton)findViewById(R.id.btn_add);
  mBtnAdd.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      addCurrentEntry();
    }
  }
);
  if (savedInstanceState == null) {
    restorePreviousPage();
  }
  mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
    @Override public void onPageSelected(    int position){
      String pageTitle=(String)getPageAdapter().getPageTitle(position);
      AppPrefs.setReaderSubsPageTitle(pageTitle);
    }
  }
);
}