title: How to check if context instance of a Fragment?
body: <p>I'm trying to check if context is a instance of my Fragment when attaching it. It works with activities, how come it doesn't work with fragments?</p>
  
  <pre><code>@Override
      public void onAttach(@NonNull Context context) {
          super.onAttach(context);
          if(context instanceof MailFragment){
  
          }
      }
  </code></pre>
  
  <p>Doesn't work, but it works with <code>context instanceof MainActivity</code></p>
  
  <p>How do I check if context is instance of Fragment?</p>