title: Flow of app within bottomsheet with fragments
body: <p><a href="https://i.stack.imgur.com/Ycyr0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ycyr0.jpg" alt="Where I'am now" /></a></p>
  <p>I'm trying to continue the flow of app within bottomsheet.</p>
  <p>Case : When a user clicks any brand suppose &quot;Levis&quot; then it should display the brand products i.e. another fragment(containing Products data) within the same bottomsheet only.</p>
  <p>Problem: the another fragment(containing Products data) is opening in a seperate frame not in the existing bottomsheet.</p>
  <p>My code on adapter holder click event:</p>
  <pre><code>    holder.cardView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
  
          String id = ld.getBrand_id();
  
          Bundle bundle = new Bundle();
          bundle.putString(&quot;somekeyvalue&quot;, String.valueOf(id));
  
          Fragment fragment = new ProductFragment();
          fragment.setArguments(bundle);
          FragmentManager fragmentManager = ((FragmentActivity) ct).getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
          fragmentTransaction.replace(R.id.frameLayout, fragment);
          fragmentTransaction.addToBackStack(null);
          fragmentTransaction.commit();
  
  
      }
  });
  </code></pre>
  <p>I'm using Google material bottomsheet.</p>
  <p>code to start bottomsheet:</p>
  <pre><code>BrandFragment bottomSheet = new BrandFragment();
  bottomSheet.show(getChildFragmentManager(),
          &quot;ModalBottomSheet&quot;);
  </code></pre>