@Override
  protected void onSaveInstanceState(Bundle outState) {

    super.onSaveInstanceState(outState);
    outState.putInt("pageCount", mTabsAdapter.getCount());
    outState.putInt("tab", mViewPager.getCurrentItem());
    //   outState.putInt("tid",tid);

  }
 @Override
 public void finishLoad(ThreadData data) {
   int exactCount = 1 + data.getThreadInfo().getReplies() / 20;
   if (mTabsAdapter.getCount() != exactCount && this.authorid == 0) {
     if (this.pid != 0) exactCount = 1;
     mTabsAdapter.setCount(exactCount);
   }
   if (this.authorid > 0) {
     exactCount = 1 + data.get__ROWS() / 20;
     mTabsAdapter.setCount(exactCount);
   }
   if (tid != data.getThreadInfo().getTid()) // mirror thread
   tid = data.getThreadInfo().getTid();
   fid = data.getThreadInfo().getFid();
   setTitle(StringUtil.unEscapeHtml(data.getThreadInfo().getSubject()));
 }
  private void createGotoDialog() {

    int count = mTabsAdapter.getCount();
    Bundle args = new Bundle();
    args.putInt("count", count);

    DialogFragment df = new GotoDialogFragment();
    df.setArguments(args);

    FragmentManager fm = getSupportFragmentManager();

    Fragment prev = fm.findFragmentByTag(GOTO_TAG);
    if (prev != null) {
      fm.beginTransaction().remove(prev).commit();
    }
    df.show(fm, GOTO_TAG);
  }