onBackPressed() deprecated, What is the alternative
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 . Maybe you have avare from Android 10 which starts from ( API_LEVEL 29 ) Now days the system provides gesture navigation feature. As ( most of the mobiles which start from API level 29 )the system supports gestures like swiping left to right to navigate back ( just like in IOS devices ). But this has led to unexpected behavior when it has been combined with horizontal swipes in applications. The problem is that the(Android confused about which kind of action is executed by the user) 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. ...
0 Comments