티스토리 뷰
특정 영역에 터치이벤트를 주고 싶을 경우가 있습니다.
이러한 경우 다음과 같이...
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent down_event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, 0);
MotionEvent up_event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, 0, 0, 0);
(View).dispatchTouchEvent(down_event);
(View).dispatchTouchEvent(up_event);
down_event.recycle();
up_event.recycle();
'Mobile > Android' 카테고리의 다른 글
| [Android]drawableLeft를 코드에서 (0) | 2015.04.17 |
|---|---|
| [Android]21버전이후 dex opt 해결 (0) | 2015.04.17 |
| [Android]ActionBar Height (0) | 2015.04.17 |
| [Android]소스상에서 theme와 style 사용하기 (0) | 2015.04.17 |
| [Android]Eclipse to Studio (0) | 2015.04.16 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- ios
- github
- SWIFT
- rxswift
- enum
- ubuntu
- nodejs
- Kotlin
- Python
- go
- intellij
- Xcode
- docker
- Linux
- MySQL
- windows10
- git
- php
- tomcat
- cocoapods
- Codable
- Spring
- Gradle
- android
- Windows
- CentOS
- war
- golang
- centos8
- Java
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함