daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. getView in fragment returns sometimes null
  2. this.mPagerAdapter  = new PagerAdapter(super.getSupportFragmentManager());
  3. ViewPager pager = (ViewPager)super.findViewById(R.id.viewpager);
  4. pager.setAdapter(this.mPagerAdapter);
  5.    
  6. public PagerAdapter(FragmentManager fm) {
  7.     super(fm);
  8.     this.main = MainFragment.newInstance();
  9.     this.list = ListFragment.newInstance();
  10. }
  11.    
  12. ViewPager pager = (ViewPager)super.findViewById(R.id.viewpager);
  13. pager.setCurrentItem(0, true);
  14. ((MainFragment)mPagerAdapter.getItem(0)).setSelectedItem(id);
  15.    
  16. TextView s = (TextView)getView().findViewById(R.id.CurrentSelection);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top