I'm trying to use the Android camera, for API 23 or above, it requires asking for permission at runtime. According to the documentation, I can accomplish that using, ActivityCompat or ContextCompat. I don't understand what are the difference between the two and their trade-offs.
Thank you for time.
There's no trade-off really. Not sure why they wrote so - checkSelfPermission() is a method of
ContextCompat
andActivityCompat
is subclass (child) ofContextCompat
so you can pass either one whenever object ofContextCompat
class is required.Inheritance hierarchy (docs):