80,337
社区成员
发帖
与我相关
我的任务
分享
/**
* 传入需要的键值即可
*
* @param keyCode
*/
private void sendKeyCode(final int keyCode) {
new Thread() {
public void run() {
try {
Instrumentation inst = new Instrumentation();
inst.sendKeyDownUpSync(keyCode);
} catch (Exception e) {
Log.e("Exception when sendPointerSync", e.toString());
}
}
}.start();
}