模拟Android设备上的按键
答
View.dispatchKeyEvent例如
答
已经试过这样吗?
Instrumentation inst = new Instrumentation();
for (int i = 0; i < 10; ++i) {
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
Thread.sleep(2000);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
Thread.sleep(2000);
}
像original作者写有
希望你觉得它useful..cheers
你知道如何创建这些从一个视图类的..或onclick监听器? – baash05 2013-02-03 10:28:41