https://github.com/mr-won/kotlin_null
null 관련 개발 경험 정리
https://github.com/mr-won/kotlin_null
kotlin null-check null-safety
Last synced: about 1 year ago
JSON representation
null 관련 개발 경험 정리
- Host: GitHub
- URL: https://github.com/mr-won/kotlin_null
- Owner: mr-won
- Created: 2023-11-04T05:08:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T05:12:19.000Z (over 2 years ago)
- Last Synced: 2025-03-18T02:27:11.090Z (about 1 year ago)
- Topics: kotlin, null-check, null-safety
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kotlin_Null
null 관련 개발 경험 정리

```
로그인에 성공하면 로그인할 때 쓴 이메일을 출력하고 로그인되지 않았을 때는 로그인해주세요 라는 문구가 출력되도록 코드를 짰다.
```

```
로그인되지 않았을 때 (= email이 null일때) null일 때 if를 사용하여 header TextView를 제어하려고 했지만 제어가 되지않고
null이 나오는 모습이다.
```
## 문제 해결방법

```
의외로 해결 방법은 간단했는데 email을 선언하는 과정에서 toString() 메서드를 제거하고 선언해주니 제대로 if문이 작동하여
email이 null 값 일때 xml의 R.id.account의 텍스트를 로그인해주세요로 수정됨을 확인하였다.
```
