private static CustomFuncManager mInstance; // 模拟物理按键onKey事件 private Instrumentation instrumentation = new Instrumentation();; public static CustomFuncManager getInstance() { if (mInstance == null) { mInstance = new CustomFuncManager(); } return mInstance; } // 发送指令参考 点击打开链接 public void sendKeyEvent(final int keyCode) { Thread thread = new Thread(new Runnable() { @Override public void run() { if (instrumentation != null) { instrumentation.sendKeyDownUpSync(keyCode); } else { Log.d("123", "instrumentation is null"); } } }); thread.start(); }
android 模拟物理按键
最新推荐文章于 2022-12-06 16:10:22 发布