Fragment trasaction, residue of previous fragment

Multi tool use


Fragment trasaction, residue of previous fragment
I'm new in creating fragments and I have little problem with it. In second activity (in layout) I have widget
<fragment
...
android:name="path to my first fragment"
...
/>
I have three fragments to swap. I make it in this way
// get fragment manager and fragment transaction
FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
// replace fragment on register form
transaction.replace(R.id.fragment, new Confirmation());
// commit transaction
transaction.commit();
and my fragments layout is wrap in two constraint layout like this
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
// additional widgets
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
</android.support.constraint.ConstraintLayout>
I found this solution on stack because I had visible remains of previous fragment. Now I have invisible reamins of previous fragment. Where I have a mistake? When I click on the position of button from previous fragment the button on this location is pressed
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.