티스토리 뷰

android remote service exception




안드로이드 notification에서 remote view 사용 시 


Bad notification posted - Couldn't expand RemoteViews for: StatusBarNotification


에러 해결방법.




잘 되던 푸시메세지가 notify시 remote service exception이 발생하는 기기발견.


앱 SDK 버전 22 / 안드로이드 버전 5.0에서 현상 발견.




대표적으로 remoteViews 사용 시 layout에 remoteview에서 사용 할 수 없는 view를 사용했을 때 


발생하는 에러인데 해당안되는 사항이니 패스.


참조 - https://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout




이번 경우는 기기에 따라 안드로이드 버전에 따라 간헐적으로 발생하는 버그 같은데


.setSmallIcon(R.drawable.notification_small_icon)
.setLargeIcon(bitmap)


위와 같이 setSmallIcon()을 먼저 호출 했을 때 발생하는 버그였다


.setLargeIcon(bitmap)
.setSmallIcon(R.drawable.notification_small_icon)


호출 순서를 setLargeIcon()을 먼저 호출 했더니 정상작동..



아마 SDK문제도 있을 것으로 예상된다 .

'Android' 카테고리의 다른 글

안드로이드 나인패치이미지 만드는 사이트  (0) 2017.05.12
Android data binding  (0) 2017.04.13
Android Espresso view class Matcher  (0) 2017.03.03
안드로이드 Multidex 오류  (0) 2017.02.15
안드로이드 키보드 숨기기  (1) 2016.11.25
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
링크
TAG
more
«   2024/05   »
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 31
글 보관함