반응형
Android에서도 UI관련 행위는 UI Thread위에서 해야한다
그렇지 않으면 아래와 같은 Exception이 발생한다
Swing의 SwingUtilities.invokeLater(Runnable r)와 같은 역할을 하는 아래의 방법을 사용하여 해결할수 있다
그렇지 않으면 아래와 같은 Exception이 발생한다
android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created .....
Swing의 SwingUtilities.invokeLater(Runnable r)와 같은 역할을 하는 아래의 방법을 사용하여 해결할수 있다
Activity.runOnUiThread(Runnable action)
View.post(Runnable action)
View.postDelayed(Runnable action, long delayMillis)
Handler.post(Runnable action)
View.post(Runnable action)
View.postDelayed(Runnable action, long delayMillis)
Handler.post(Runnable action)
반응형
'지식쌓기 > 개발-Android' 카테고리의 다른 글
| Android - resultCode from TabActivity (6) | 2009.10.26 |
|---|---|
| Android - MimeType으로 image얻어오기 (3) | 2009.05.26 |
| Android - Change Tab Background (7) | 2009.05.21 |
| Android - Shape XML Examples (1) | 2009.05.21 |
| Android - TabWidget의 background 변경 (4) | 2009.05.20 |