Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends MvpAppCompatActivity {
- private LinearLayout mLoc;
- private ImageView mIVBack, mIVFilt;
- private ToastUtil mToast;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toolbar tb = findViewById(R.id.include);
- setSupportActionBar(tb);
- mToast = new ToastUtil();
- mLoc = tb.findViewById(R.id.tbLoc);
- mIVBack = tb.findViewById(R.id.ivTbBack);
- mIVFilt = tb.findViewById(R.id.ivFilter);
- showFragment(new MainFragment());
- }
- public void showFragment(Fragment fragment){
- getSupportFragmentManager()
- .beginTransaction()
- .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
- .replace(R.id.container, fragment)
- .commit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment