title: How to access Views again after onCreateView in Fragment?
body: <p>Actually I'm using Fragments with FragmentPagerAdapter, but I have the problem which is null when i tried to access views again in fragment. pageNum is null as well. I tried many ways to figure it out but it didn't work though.</p>
  
  <p>FirstFragment.java</p>
  
  <pre><code>public class FirstFragment extends Fragment{
      private int pageNum;
      private TextView titleTxt;
      private LinearLayout topPan;
  
      public static FirstFragment newInstance(int page) {
          FirstFragment fragment = new FirstFragment();
          Bundle args = new Bundle();
          args.putInt("page", page);
          fragment.setArguments(args);
          return fragment;
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          pageNum = getArguments().getInt("page", 0);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.workflow_item_layout, container, false);
          titleTxt = (TextView)    view.findViewById(R.id.title);
          topPan   = (FrameLayout) view.findViewById(R.id.top_pan);
      }
  
      public void setTopPanVisible(boolean isVisible) {
          topPan.setVisibility(isVisible);
      }
  </code></pre>
  
  <p>pageChangeListener codes</p>
  
  <pre><code>private ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener() {
          @Override
          public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
          }
  
          @Override
          public void onPageSelected(int position) {
          }
  
          @Override
          public void onPageScrollStateChanged(int state) {
              final int position = pager.getCurrentItem();
  
              if (state == ViewPager.SCROLL_STATE_IDLE) {
                  final FirstFragment fragment = (FirstFragment) adapter.getItem(position);
                  fragment.setTopPanVisible(true);
  </code></pre>
  
  <p>topPan is null when i called 'setTopPanVisible' in pageChangeListener. How can Views keep alive to have a value? </p>