In general, I want to make a kind of TabLayout with ViewPager but without using the first and second. In the role of TabLayout, I will have buttons and in the role of ViewPager - FrameLayout. I think it is not necessary to explain the theory how it should work. For those who tell me that this is stupid - I need this way. And the problem is this, I kind of did everything, I click on the button, another one is pasted on the old fragment and so on, but when I click on that fragment I’ve already clicked on and it’s already on the stack, an error is thrown. I need a button to display a specific fragment in FrameLayout, but here the stack of fragments prevents me from doing what

  • First, you need to do the following - arrange the question according to the requirements of this resource , that is, create a minimal reproducible example. - pavlofff
  • I calculated your IP, but the firewall did not let me get into the folder with your project and I cannot see your code and say what is wrong there. You will have to post the minimum code here, specify the fall line and the error logs of the hello error - Yuriy SPb
  • Before creating a fragment, you need to check its presence in the FragmentManager if it is there - get it and set it in FrameLayout. This is exactly what ViewPager does - Vitaly
  • and what method to put it in FarmeLayout if it already exists - Dimantik02

0