Answer the question
In order to leave comments, you need to log in
How to change fragments?
The form has a BottomNavigationView. I want that on pressing of one button there was one fragment, on pressing of another - another. How to do it? Read about fragments. I just know how to add them. But I do not understand exactly how to organize their change.
upd. Found this way:
supportFragmentManager.beginTransaction().replace(R.id.content, MyFragment()).commit()
Answer the question
In order to leave comments, you need to log in
In the fragment markup file for the main container, add
<android.support.constraint.ConstraintLayout // ваш контейнер
...
android:background="@color/white"
android:clickable="true"
android:focusable="true" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question