android 模拟按键事件

        new Thread () { 
                    public void run () { 
                        try { 
                                 Instrumentation inst=new Instrumentation();
                    inst.sendKeyDownUpSync(int  键码);
                        } catch(Exception e) { 
                                Log.e("Exception when sendPointerSync", e.toString()); 
                        } 
                    } 
                }.start(); 

原文地址:https://www.cnblogs.com/leaven/p/2209777.html