在一個(gè)工程里面 用
Instrumentation.sendKeyDownUpSync(code);
這樣程序可以完成運(yùn)行 也實(shí)現(xiàn)了這個(gè)功能 但是用
Instrumentation.sendPointerSync(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 1, 1, 0));
就會(huì)出錯(cuò) 出錯(cuò)信息是 java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission
這是在同一個(gè)工程里點(diǎn)擊啊 怎么還會(huì)出這個(gè)錯(cuò)啊 求個(gè)大神幫忙說說啊 困擾很久了
關(guān)于Instrumentation的sendPointerSync()
動(dòng)漫人物
2019-02-17 08:01:38