Fixing missing call to timer.cancel() when view is detached

This commit is contained in:
Maxime NATUREL 2022-07-28 14:50:13 +02:00
parent f44d8b0b20
commit 2c10d9dcaa
1 changed files with 5 additions and 0 deletions

View File

@ -128,4 +128,9 @@ class LiveLocationRunningBannerView @JvmOverloads constructor(
title.text = context.getString(R.string.location_share_live_view)
subTitle.text = context.getString(R.string.location_share_live_until, viewState.formattedLocalTimeOfEndOfLive)
}
override fun onDetachedFromWindow() {
countDownTimer?.cancel()
super.onDetachedFromWindow()
}
}