I'm creating an Android app using MVVM and view binding. My home fragment has a ScrollView with three horizontal RecyclerViews inside.
When the user navigates to another view by clicking on an item & then returns to the home fragment on back press, I want the ScrollView to be at the top instead of returning to the part of the screen that was clicked.
I've tried this in my home fragment, but it didn't so anything:
binding.container.requestFocus(View.FOCUS_UP);
binding.container.scrollTo(0,0);
Any other suggestions would be appreciated.