Fragment replacing in RecyclerView item
<p>In my RecyclerView I need replace part of my item to my fragment. But replacing <strong>only first item</strong> in recycler view. What I am doing is wrong?</p>

<p>My container (in recycler view item):</p>

<pre><code>...
&lt;FrameLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/container" /&gt;
...
</code></pre>

<p>My update code in RecyclerView adapter:</p>

<pre><code>...
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

...

MyFragment fragment = MyFragment.newInstance("fragment1");
fragmentManager.beginTransaction().replace(R.id.container, fragment).commit();

...

}
...
</code></pre>