Is there a way to switch to an HDMI input programmatically on Android TV? I.e. a Smart TV, not a separate box.
What I was trying is to send a key event, but nothing happens when I run this:
# `someButton` is a button on the `activity_main.xml`
val inputConnection = BaseInputConnection(someButton.rootView, true);
inputConnection.sendKeyEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_TV_INPUT_HDMI_4,
)
)
inputConnection.sendKeyEvent(
KeyEvent(
KeyEvent.ACTION_UP,
KeyEvent.KEYCODE_TV_INPUT_HDMI_4,
)
)
Should this work, but I am doing something wrong? Is there another way to do this?
Running it via adb from my computer works:
adb connect MY_TV
adb shell input keyevent 246
For reference, what I tried so far:
sendKeyEvent
from here, but as mentioned did not work: How can I send key events in android?exec("input keycode 246")
and instrumentation.sendKeyDownUpSync(...)
. It did not work, but as I understand it, those need special privileges anyway.Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
In our system, a user can be of 2 types
How can I mirror the d3 tree? I have use these code https://observablehqcom/@d3/zoomable-icicle but I can't put the father at right
I'm trying to implement a feature in my table where I need the current row index after a filter is applied in React-Table