title: How to get the current visible fragment in android?
body: <p>I have MainActivity and inside this activity i have four <code>fragments</code>. The fragment name are <code>A,B,C,D.</code></p>
  
  <pre><code>Fragment currentVisibleFragment = getSupportFragmentManager().findFragmentByTag(null);
  </code></pre>
  
  <p>using this above line i am trying to get the current visible <code>fragment</code> but i cant get the current visible fragment.            </p>