bsod_keks

MainActivity

Nov 12th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public class MainActivity extends MvpAppCompatActivity {
  2.  
  3. private LinearLayout mLoc;
  4. private ImageView mIVBack, mIVFilt;
  5. private ToastUtil mToast;
  6.  
  7. @Override
  8. protected void onCreate(Bundle savedInstanceState) {
  9. super.onCreate(savedInstanceState);
  10. setContentView(R.layout.activity_main);
  11. Toolbar tb = findViewById(R.id.include);
  12. setSupportActionBar(tb);
  13.  
  14. mToast = new ToastUtil();
  15. mLoc = tb.findViewById(R.id.tbLoc);
  16. mIVBack = tb.findViewById(R.id.ivTbBack);
  17. mIVFilt = tb.findViewById(R.id.ivFilter);
  18. showFragment(new MainFragment());
  19. }
  20.  
  21. public void showFragment(Fragment fragment){
  22.  
  23. getSupportFragmentManager()
  24. .beginTransaction()
  25. .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
  26. .replace(R.id.container, fragment)
  27. .commit();
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment