I have stored some data to a Global Class By using the Application Context In One Activity. Later I have to Retrieve those values in A Fragment. I have done something like t
In Support Library 27.1.0 and later, Google has introduced new methods requireContext() and requireActivity() methods.
requireContext()
requireActivity()
Eg:ContextCompat.getColor(requireContext(), R.color.soft_gray)
ContextCompat.getColor(requireContext(), R.color.soft_gray)
More info here