Skip to content

Instantly share code, notes, and snippets.

@ramuta
Created November 21, 2014 11:46
Show Gist options
  • Save ramuta/4d369990e8b8e0fc7047 to your computer and use it in GitHub Desktop.
Save ramuta/4d369990e8b8e0fc7047 to your computer and use it in GitHub Desktop.
Go to another fragment from fragment
In FragmentActivity set ViewPager as public static:
public static ViewPager viewPager;
Now you can access it from every child Fragment:
MainActivity.viewPager.setCurrentItem(6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment