android系统中模拟其他按键
2019-10-15 本文已影响0人
辉色投像
private void sendKeyEvent(final int KeyCode) {
new Thread() {
public void run() {
try {
Instrumentation inst = new Instrumentation();
inst.sendKeyDownUpSync(KeyCode);
} catch (Exception e) {
LogUtils.i(TAG, "Exception " + e.toString());
}
}
}.start();
}