'LocalBroadcastManager' is deprecated. Deprecated in Java
개발을 하던 중 LocalBroadcastManager 가 deprecated 되었다는 오류가 떴다.
override fun onResume() {
super.onResume()
LocalBroadcastManager.getInstance(this).registerReceiver(
mRegistrationBroadcastReceiver,
IntentFilter(Constants.Intent.FCM_UNREGISTRATION_COMPLETE)
)
}
override fun onDestroy() {
super.onDestroy()
LocalBroadcastManager.getInstance(this).unregisterReceiver(mRegistrationBroadcastReceiver)
}
다음과 같이 수정해주면 된다.
override fun onResume() {
super.onResume()
registerReceiver(
mRegistrationBroadcastReceiver,
IntentFilter(Constants.Intent.FCM_UNREGISTRATION_COMPLETE)
)
}
override fun onDestroy() {
super.onDestroy()
unregisterReceiver(mRegistrationBroadcastReceiver)
}
참고 : https://developer.android.com/jetpack/androidx/releases/localbroadcastmanager?hl=ko
https://stackoverflow.com/questions/74264850/localbroadcastmanager-is-now-deprecated-how-to-send-data-from-service-to-activi