Whats the proper way to handle the selected state of the navigation drawer after back press?
I have a navigation drawer with n entries (in a listview) like the SDK sampl
Here is a solution in kotlin.
In the fragment that you want to be selected and highlighted by the drawer, you simply do:
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val navView: NavigationView = activity!!.findViewById(R.id.nav_view)
navView.setCheckedItem(R.id.name_of_this_fragment)
...
}