title: How to listen to FragmentStatePagerAdapter setPrimaryItem from a Activity
body: <p>I just started coding android and I have a ViewPager inside a fragment and what I want to do is how to listen to setPrimaryItem event of ViewPagerAdapter from it's activity so I can pass data from the adapter to the activity.</p>
  
  <p>I tried using interface but I don't know how to get the activity inside the adapter.</p>