0
Android devs
Hi guys, I'm just learning android. Can u say me what's the difference between onoptionsitemselected() vs onnavigationitemselected(). Saw these two are used in different examples for navigation drawer. First function i used to open and close nav. With second function to get each selected item. So nav can close and open without first function? Please help to understand what's going on.
3 Answers
+ 2
Hi I am an Android dev
To answer your question on optionitemselected() is used to listen to an object in a menu or a navigation drawer etc.
On the other hand on navigationitemselected is used to listen if a navigation bar item is selected
+ 2
Are you using Jetpack Compose or XML?
0
Justice xml