I defined ConsumerIrManager as following:
ConsumerIrManager irManager = (ConsumerIrManager) getSystemService(CONSUMER_IR_SERVICE);
But for some reason it is null and I can't use functions like .transmit().
1 Answer 1
You are not guaranteed to get the service. There are multiple cases which can lead to null you are facing, starting from most obvious one, which is lack of hardware support for IR on the device to missing android.permission.TRANSMIT_IR permission declared in your AndroidManifest.xml file. I'd also inspect logcat and look for any related warning or error.
answered Oct 14, 2023 at 20:36
Marcin Orlowski
75.7k11 gold badges128 silver badges152 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-java