Android Support Library 27.1.0 new methods requireActivity(), requireContext() : <p>According to the support library changelog and the Fragment class documentation (<a href="https://developer.android.com/reference/android/support/v4/app/Fragment.html" rel="noreferrer">https://developer.android.com/reference/android/support/v4/app/Fragment.html</a>), there are now new methods like requreActivity() and requireContext().</p>

<p>What is the purpose of these methods compared to getActivity() and getContext(), since they can still throw IllegalStateExceptions? Is this preferable to returning null when an activity or context cannot be found? And should I simply replace every getActivity() with requireActivity()?</p>
