title: Fragment setuserVisibleHint true but getActivity returns null
body: <p>I've been doing some logic inside of a fragment's <code>setUserVisibleHint()</code> method. I was always checking if <code>isVisibleToUser</code> is true and then used <code>getActivity</code> to return the activity. This was working well (100% of the time) until I updated the support library to the latest(<code>support:appcompat-v7:24.2.0</code>). Now <code>getActivity</code> always returns null. Are there some changes to the support library that explain this behaviour?</p>
  
  <pre><code>@Override
  public void setUserVisibleHint(boolean isVisibleToUser) {
      super.setUserVisibleHint(false);
  
      if (isVisibleToUser) {
        getActivity() &lt;- null
      }
  </code></pre>