Guest User

Untitled

a guest
Jul 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public class MainActivityPagerAdapter extends PagerAdapter {
  2.  
  3. public MainActivityPagerAdapter(FragmentManager fm, int numOfTabs) {
  4. super(fm, numOfTabs);
  5. }
  6.  
  7. @Override
  8. public Fragment getItem(int position) {
  9.  
  10. switch (position) {
  11. case 0:
  12. return new StoresFragment();
  13. case 1:
  14. return new OrdersFragment();
  15. default:
  16. return null;
  17. }
  18. }
  19. }
  20.  
  21. Intent intent = new Intent(context, MainActivity.class);
  22. intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
  23. startActivity(intent);
  24. finish(); //finishAffinity();
Add Comment
Please, Sign In to add comment