title: open a Fragment by clicking on a recyclerview item and move to this fragment
body: <p>i'm trying to open a Fragment by clicking on a recyclerview item, what i'm getting after clicking on item is both fragment toghter, i see the image from the fragment that i want to go to after the clicking on my recyclerview..Does anyone have any idea what i'm doing wrong?</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private FragmentManager manger;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          ArrayList&lt;Chat&gt; chatList = new ArrayList&lt;&gt;();
          chatList.add(new Chat("send post card", " ", R.drawable.sentpostcard));
          chatList.add(new Chat("send greeting card", "happy holiday", R.drawable.greetingcard));
          chatList.add(new Chat("special designs", "choose a card", R.drawable.special));
  
  
          ChatAdapter adapter = new ChatAdapter(chatList);
          RecyclerView recyclerView = (RecyclerView) findViewById(R.id.chatList);
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
          recyclerView.setAdapter(adapter);
  
      }
  
  
  
      // 1
      public class ChatAdapter extends RecyclerView.Adapter&lt;ChatAdapter.ChatViewHolder&gt;{
  
          // 7
          private ArrayList&lt;Chat&gt; chats;
  
          // 8
          public ChatAdapter(ArrayList&lt;Chat&gt; chats) {
              this.chats = chats;
          }
  
          // 10
          @Override
          public ChatViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
              LayoutInflater inflater = getLayoutInflater();
              View v = inflater.inflate(R.layout.chat_list_item, parent, false); // false == do not attach to root
              return new ChatViewHolder(v);
          }
  
          // 11
          @Override
          public void onBindViewHolder(ChatViewHolder holder, int position) {
              holder.bind( chats.get(position) );
          }
  
          // 9
          @Override
          public int getItemCount() {
              return chats.size();
          }
  
          // 2
          public class ChatViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
              //4
              private TextView textName, textChat;
              private ImageView imageChat;
  
              //we need to remember a chat for each view holder and we bind the chat object using the bind function
              //this will be useful later in the onClick Listener
              private Chat c;
  
              // view is the layout view ==&gt; it contains all of the view in the layout file
              // 3
              public ChatViewHolder(View itemView) {
                  super(itemView);
                  // 5
                  textName = (TextView) itemView.findViewById(R.id.textName);
                  textChat = (TextView) itemView.findViewById(R.id.textChat);
                  imageChat = (ImageView) itemView.findViewById(R.id.imageChat);
  
  
  
                  // 12
                  itemView.setOnClickListener(this);
              }
  
              // 6
              public void bind(Chat chat){
                  c = chat;
                  textName.setText(chat.getName());
                  textChat.setText(chat.getText());
                  imageChat.setImageResource(chat.getImage());
              }
  
              @Override
              public void onClick(View v) {
  
                  getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,new FragA()).commit();
  
  
              }
  
              }
          }
      }
  </code></pre>