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