How to change activity on bottom navigation button click?

前端 未结 2 1717
温柔的废话
温柔的废话 2020-12-25 14:01

I want to use bottom navigation bar in my existing android app but the problem is all screen are activity ,is it possible to load activity without hiding the bottom navigati

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-25 14:07

    With Activity, you have to declare and init that BottomBar each time you load that activity.

    With your problem, my answer is NO.

    Btw, you can use Fragment which helps you solve this pretty good.

    Time to learn something new, bro.

    EDIT

    You bring Fragment inside only 1 Activity. And let BottomBar inside Activity while all others view and data set inside Fragment.

    Just try it!

提交回复
热议问题