분류 | 게시판 |
베스트 |
|
유머 |
|
이야기 |
|
이슈 |
|
생활 |
|
취미 |
|
학술 |
|
방송연예 |
|
방송프로그램 |
|
디지털 |
|
스포츠 |
|
야구팀 |
|
게임1 |
|
게임2 |
|
기타 |
|
운영 |
|
임시게시판 |
|
옵션 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | public class TestInstrumentation extends InstrumentationTestCase { private Instrumentation i; private UiAutomation automation; final long eventTime = SystemClock.uptimeMillis(); private int inputDevice = InputDevice.SOURCE_TOUCHSCREEN; @Override public void setUp() throws Exception { super.setUp(); i = getInstrumentation(); automation = i.getUiAutomation();//오류 발생!! } public void uiautomationTouch(int x, int y){ MotionEvent motionDown = MotionEvent.obtain(eventTime, eventTime, KeyEvent.ACTION_DOWN, x, y, 0); motionDown.setSource(inputDevice); automation.injectInputEvent(motionDown, true); MotionEvent motionUp = MotionEvent.obtain(eventTime, eventTime, KeyEvent.ACTION_UP, x, y, 0); motionUp.setSource(inputDevice); automation.injectInputEvent(motionUp, true); motionUp.recycle(); motionDown.recycle(); } } | cs |
죄송합니다. 댓글 작성은 회원만 가능합니다.