Issue
I'm trying to practice building apps with Kotlin with Android Studio, I'm using the google material design Bottom Navigation Bar.. But when I use this, I get a warning:
'setOnNavigationItemSelectedListener(BottomNavigationView.OnNavigationItemSelectedListener?): Unit' is deprecated. Deprecated in Java
So my question: How do I replaced this with a recent one? What do I do next time a come a deprecated unit like?? lastly, If I should ignore this warning and, go ahead with developing and publishing an App with it will there be consequences?? is yes, like what??
Thank you for your time and contribution in advance..
Solution
Replace it with setonItemSelectedListener
according to material documentation it has been depecrated in favor of the listeners in NavigationBarView
This allows you to share selection handling code between the BottomNavigation
and NavigationRail
view elements, and behaves in the same way.
Answered By - Nestor Perez
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.