Answer the question
In order to leave comments, you need to log in
How to check which button was pressed?
Hung the listener on Bottom Nav. I want that when I click on the desired tab, the corresponding fragment opens. To do this, I take the id from the MenuItem and check it in the switch. The studio issues the following warning:
Is it safe to do such a check, or is there a more reliable way?
Answer the question
In order to leave comments, you need to log in
do if() {} else if()...
or stop writing java and use kotlin.
Here the studio just tells you that this code will break in the future. It will not work incorrectly, but will simply stop compiling.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question