У нас вы можете посмотреть бесплатно onBacPressed() deprecated What's the Alternative? Kotlin Android Studio или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
onBacPressed() deprecated What's the Alternative? Kotlin Android Studio onBackPressed() Deprecated, What is the Alternative? If you have updated any of your application to API LEVEL 33, you have seen this error, onBackPressed is deprecated. Let’s talk about why there is such a change. You may know that from Android 10 (API_LEVEL 29) the system provide gesture navigation feature. As, the system supports gestures like swiping left to right to navigate back ( just like in IOS devices ). But this has led unexpected behavior when it has been combined with horizontal swipes in applications. The problem is that the android system cannot differentiate if the gesture is for system back or for application back navigation. Which led to problems like closing an entire application instead of navigating back to the required activity or fragment. In other words, It cannot tell if the application handles the gesture. So, What to be used instead? So I have came across two solutions for achieving this problem, The first is to use the old function of onBackPressed, instead of calling the super.onBackPressed you can simply use isTaskRoot to check this activity is the last on stack or not, and the other solution is provided by the android itself the alternative way of handling backpressed events.