Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- OTTO
- ButterKnife
- VMware
- 안드로이드 스튜디오
- Mac
- 안드로이드
- 라이브러리
- Logcat
- 이미지로딩 라이브러리
- Picasso
- 아마존웹서비스
- 커스텀뷰
- Glide
- AWS
- 안드로이드 라이브러리
- Today
- 174
- Total
- 1,761,401
박상권의 삽질블로그
Event bus [Bus "default"] accessed from non-main thread Looper 본문
IT/Android-ERROR&SOLVE
Event bus [Bus "default"] accessed from non-main thread Looper
박상권 2015. 11. 16. 19:15
제가 운영하고 있는 유튜브 채널 '개발자 테드박'에도 많은 관심 부탁드려요.
스타트업/개발자/IT 관련된 여러 영상을 올리고 있습니다.
영상보러가기
블로그를 Medium으로 옮겨서 운영하고 있습니다.
앞으로 새로운 글은 모두 미디엄 블로그를 통해서 올릴 예정입니다.
미디엄에서 다양하고 유익한 포스팅을 살펴보세요
미디엄 블로그 보기
Otto를 사용하는경우 GCM을 위한 intentservice같은 곳곳에서 post를 보내는경우 오류가 발생할 수 있다.
Otto의 Bus클래스를 상속받아서 아래와같은 클래스를 만들고 이 클래스를 사용한다
public class CustomBus extends Bus {
private final Handler mHandler = new Handler(Looper.getMainLooper());
@Override
public void post(final Object event) {
if (Looper.myLooper() == Looper.getMainLooper()) {
super.post(event);
} else {
mHandler.post(new Runnable() {
@Override
public void run() {
CustomBus.super.post(event);
}
});
}
}
}
'IT > Android-ERROR&SOLVE' 카테고리의 다른 글
String types not allowed (0) | 2016.01.07 |
---|---|
java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to (0) | 2015.12.21 |
[Android ERROR&SOLVE]GC overhead limit exceeded (0) | 2015.11.06 |
[Android ERROR&SOLVE]org.apache.http does not exist (0) | 2015.11.05 |
[Android ERROR&SOLVE]Default Activity Not Found (0) | 2015.10.22 |
1 Comments