고도고도
🍎🍏
고도고도
전체 방문자
13,424
오늘
31
어제
64
  • 분류 전체보기 (170)
    • 🔨 프로젝트 (0)
      • TP 1 (0)
      • WhiteHCCTV (0)
      • FootPrint (0)
    • 💻 개발 (61)
      • iOS (28)
      • Android (6)
      • Kotlin (4)
      • Flutter (9)
      • Node.js (5)
      • Architecture (1)
      • 오늘의 삽질 (7)
      • 에러와의 동침 (1)
    • ✏️ 알고리즘 (6)
      • Graph (6)
      • String (0)
      • Sort (0)
    • ✍️ 코테 준비 (44)
      • Math (1)
      • Implementation (3)
      • String (3)
      • Brute Force (5)
      • Back Tracking (7)
      • Greedy (0)
      • Dynamic Programming (13)
      • Binary Search (1)
      • DFS, BFS (5)
      • Shortest Path (2)
      • Two Pointer (4)
      • MST (0)
    • 📚 CS (6)
      • Operating System (6)
    • ⛹️ 라이프 (53)
      • 2020 겨울방학 모칵코(팀) (13)
      • 2020 겨울방학 모각코(개인) (13)
      • 2021 여름방학 모칵코(팀) (8)
      • 2021 여름방학 모각코(개인) (7)
      • 코딩 테스트 (1)
      • 회고 (10)

블로그 메뉴

  • 홈
  • 깃허브
  • 링크드인

공지사항

인기 글

  • [NCSOFT] 2022 엔씨소프트 썸머 인턴 후기 - 1⋯
    2022.08.10
    [NCSOFT] 2022 엔씨소프트 썸머 인턴 후기 - 1⋯
  • [Flutter] SingleChildScrollView,⋯
    2021.08.18
    [Flutter] SingleChildScrollView,⋯
  • [iOS / SwiftUI] MapKit, 실시간으로 도로⋯
    2022.12.20
    [iOS / SwiftUI] MapKit, 실시간으로 도로⋯
  • [Android] 백그라운드에서 소켓 통신으로 이벤트 수신⋯
    2022.06.08
    [Android] 백그라운드에서 소켓 통신으로 이벤트 수신⋯
  • [iOS / SwiftUI] OnAppear, OnDisa⋯
    2022.12.01
    [iOS / SwiftUI] OnAppear, OnDisa⋯

최근 댓글

  • https://developer.apple.com/docu⋯
    고도고도
  • 게시글 잘 보았습니다. 혹시 주소에서 구를 가지고 오시는⋯
    나그네
  • 혹시 댓글이 안보이는데 .. y2e010924@naver.⋯
    eun
  • 글 솜씨가 뛰어나시네요! 좋은 글 잘 보고 갑니다 다음에도⋯
    alpha-traveler
  • NC......가슴이...웅장해집니다.......🤯
    이상한핑구 🐧

최근 글

  • [Architecture] MVVM + Clean Arch⋯
    2023.01.07
    [Architecture] MVVM + Clean Arch⋯
  • [iOS / SwiftUI] MapKit, 실시간으로 도로⋯
    2022.12.20
    [iOS / SwiftUI] MapKit, 실시간으로 도로⋯
  • [iOS / SwiftUI] OnAppear, OnDisa⋯
    2022.12.01
    [iOS / SwiftUI] OnAppear, OnDisa⋯
  • [에러와의 동침] 22년 11월 4주차
    2022.11.28
    [에러와의 동침] 22년 11월 4주차
  • [iOS / SwiftUI] 스크롤, 무한으로 즐겨요~ (⋯
    2022.11.28
    [iOS / SwiftUI] 스크롤, 무한으로 즐겨요~ (⋯

티스토리

hELLO · Designed By 정상우.
고도고도

🍎🍏

[Android / Kotlin] Failed to call observer method
💻 개발/오늘의 삽질

[Android / Kotlin] Failed to call observer method

2022. 3. 30. 23:57

오류 발생

Databinding + ViewModel + LiveData 로 간단한 MVVM 예제를 구현하기 위해 Databinding 으로 표현할 변수(?)를 layout 안에 <data> 블럭에 넣어줬더니 발생한 오류

오류 내용

해결

String 으로 변환하지 않아서 발생한 문제... ㅋㅋㅋㅋㅋ... toString() 을 해줬더니 정상적으로 작동했다.

        <TextView
            android:id="@+id/displayNumberTextView"
            android:layout_width="0dp"
            android:layout_height="100dp"
            android:layout_marginHorizontal="18dp"
            android:gravity="center"
            android:text="@{bindingMainViewModel.getNumber().toString()}"
            android:textSize="50sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

참고

MVVM 예제
StackOverFlow

저작자표시 비영리 변경금지

'💻 개발 > 오늘의 삽질' 카테고리의 다른 글

[iOS / Swift] Exception NSException * "-[UIView setText:]: unrecognized selector sent to instance  (0) 2022.09.07
[iOS / Swift] unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard  (0) 2022.08.21
[Android / Gradle] mockup1/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.  (0) 2022.08.13
[Android / Gradle] The current Gradle version is not compatible with the Kotlin Gradle plugin  (0) 2022.08.09
[Git / Github] Refusing to merge unrelated histories  (0) 2021.08.12
    '💻 개발/오늘의 삽질' 카테고리의 다른 글
    • [iOS / Swift] unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
    • [Android / Gradle] mockup1/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
    • [Android / Gradle] The current Gradle version is not compatible with the Kotlin Gradle plugin
    • [Git / Github] Refusing to merge unrelated histories
    고도고도
    고도고도
    iOS 꿀잼
    댓글쓰기
    [Android / Gradle] The current Gradle version is not compatible with the Kotlin Gradle plugin
    다음 글
    [Android / Gradle] The current Gradle version is not compatible with the Kotlin Gradle plugin
    [Git / Github] Refusing to merge unrelated histories
    이전 글
    [Git / Github] Refusing to merge unrelated histories

    티스토리툴바