title: How do i replace the existing contents in the recyclerview with the selected directory's files?
body: <p><a href="https://i.stack.imgur.com/jDxtE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jDxtE.png" alt="enter image description here"></a></p>
  
  <p>In the above image, the first tab displays the files/folders in the root directory of the sdcard. I am using the checkbox to select the files. The problem is when I select a folder, I want to replace the <code>Recyclerview</code> contents with the contents of the selected folder's files. If the folder has a subfolder, then clicking that should replace the contents again. Basically, I want the functionality of a file explorer here. I also want it to remember which files have been checked as those files will be sent to another device.</p>
  
  <p>The code to display the existing <code>Recyclerview</code>is fairly simple. I am assigning an ArrayList of files(inside the root directory) to the <code>Recyclerview</code> adapter.</p>
  
  <p>Any help is appreciated. Thanks.</p>