title: How to pass data between nested fragments?
body: <p>I am trying to pass data between nested fragments in the following way:</p>
  
  <p>From stored data in one class, I have loaded data into viewPager fragment <strong>(Fragment #1)</strong>, displayed as such:
  <a href="https://i.stack.imgur.com/L2QCl.png" rel="nofollow noreferrer">Fragment#1</a></p>
  
  <p>Now when the <strong>Btn</strong> is clicked, another fragment (<strong>Fragment#2</strong>), should launch with data that corresponds with <strong>Fragment#1</strong>, displayed as such:
  <a href="https://i.stack.imgur.com/t6KTA.png" rel="nofollow noreferrer">Fragment#2</a>
  The data for <strong>Fragment#2</strong> is coming from <strong>Fragment#1</strong>, which is receiving the data from the class which has the stored data. Suppose there are multiple, <strong>Fragment#1</strong> components in the same viewPager that have the <strong>Btn</strong> and when clicked would have to show <strong>Fragment#2</strong> with data that are specific to each of the <strong>Fragment#1</strong> components. What would be the best approach at trying to tackle this?</p>
  
  <p>I have tried a similar approach, where instead of nested fragments, a fullscreendialog similar to <a href="https://i.stack.imgur.com/t6KTA.png" rel="nofollow noreferrer">Fragment#2</a> would appear. But that approach was futile since the dialogs could not properly keep track of the fragment position.</p>