[Android] 프로퍼티의 초기화 시점이 중요한 이유!
·
Android
🚨 Trouble Shooting 다음과 같이 context를 매개변수로 전달받는 클래스를 TestActivity에서 호출할 때 다음과 같은 에러가 발생했습니다. 파란 줄을 보시면 context를 전달받을 때 null이 전달되어 NullPointerException 이 발생했습니다. class FusedLocationProvider ( private val context: Context, private val listener: OnLocationUpdateListener ) class TestActivity: AppCompatActivity(), OnLocationUpdateListener { private var fusedLocationProvider = FusedLocationProvider(this..