在Android中调用键preSS事件?事件、Android、preSS

2023-09-05 11:23:50 作者:横尸遍野

我需要在Android中调用一个关键的preSS事件。 任何建议?????

I need to invoke a key press event in android . Any suggestions ?????

推荐答案

您需要使用仪器仪表类:

You need to use the instrumentation class :

Instrumentation i = new Instrumentation();
i.sendKeyDownUpSync(KeyEvent.KEYCODE_A);

这应该是相当于pssed在键盘上甲A $ P $。

This should be equivalent to a A pressed on the keyboard.

 
精彩推荐
图片推荐