Hello, I need help, where to place it .setOnItemSelectedListener, in the Switch section it gives me an error, The error is: Constant expression required, in the cases, the identifiers are written correctly, but I get that error, what is the reason for that?
I removed (finish) because I don't want the application to exit as soon as you click the back button and everything works, but the problem is that when you click the back button, the selected item is not marked with a selector it going random
Are you using latest android studio flamingo? If yes, then it's because of material active indicator. If no, then give theme accordingly and also you can create a seperate selector for it.
In activity, same code is repeated multiple times while in fragments you can reduce the repetition of code. For more detail, refer the below link: stackoverflow.com/questions/50119455/is-it-not-recommended-to-use-activities-with-bottom-navigation
The variable might not be defined properly. You can check the below link for more details: stackoverflow.com/questions/37706672/cannot-resolve-method-finditemint
I have mentioned in the video that bottom navigation with activities is not a recommended way instead use fragments. This video is just for an experimental purpose :-)
Very nice videos It helped me in my project very much....Thankyou very much.
I'll recommend your videos to my fellows as well..👍
Thanks, a lot :-)
Hello, whu my icons are jumping if i remove slide animations, can it be fixed?
case R.id.bottom_home: error: Constant expression required. How do I fix this please help😢 13:30
Same error
I've met a similar error. Click on switch, then alt+enter and "replace switch with if"
This works. Thank you.
use if-else constuction
@@ДанилАнуфриев-э3к❤❤❤❤❤ 😭😭😭❤❤❤❤❤❤ thanku thanku thanku so much 😊🙏🙏🙏🙏🙏🙏❤❤❤❤❤❤❤❤
Hello, I need help, where to place it .setOnItemSelectedListener, in the Switch section it gives me an error, The error is: Constant expression required, in the cases, the identifiers are written correctly, but I get that error, what is the reason for that?
Please, use if else instead of switch case :-)
@@android_knowledge i get Unexpected return value on all true and false now with an if else
Awesome very helpful video 👏
Thanks :-)
Ohh is was not following the principal of DRY.How can we refector this ?
Keep going 🥳
😊👍🏻
I removed (finish) because I don't want the application to exit as soon as you click the back button and everything works, but the problem is that when you click the back button, the selected item is not marked with a selector it going random
same issue
@@samriddhpandey745 put something like this @Override
protected void onResume() {
super.onResume();
BottomNavigationView bottomNavigationView = findViewById(R.id.MENUITEM);
bottomNavigationView.setSelectedItemId(R.id.MENUITEM);
}
when I'm in an item, the item becomes appropriately white but its background becomes kind of pink...do u know why?
Are you using latest android studio flamingo?
If yes, then it's because of material active indicator.
If no, then give theme accordingly and also you can create a seperate selector for it.
why do you recommend to use fragment instead of activity in bottom navigation bar?
In activity, same code is repeated multiple times while in fragments you can reduce the repetition of code.
For more detail, refer the below link:
stackoverflow.com/questions/50119455/is-it-not-recommended-to-use-activities-with-bottom-navigation
@@android_knowledge activity is repeated created and fragment replace
correct
why android BottomAppBar have extra bottom padding?
bro can u do this for kotlin pls?
Thanks for sharing 😊
😊👍🏻
Cannot resolve method 'getItemId' in 'View' how to resolve this
@Android Knowledge
"bottom_menu" is empty in design. how can i solve this?
Change background color it seems like its blank but itd actually becoz of white color background
Error, How to resolve this?
Cannot resolve method 'setOnItemSelectedListener' in 'BottomNavigationView'
Cannot resolve method 'getItemId()'
The variable might not be defined properly.
You can check the below link for more details:
stackoverflow.com/questions/37706672/cannot-resolve-method-finditemint
Keep Going :)
Thank you 😊
hello sir i need help when i run a code i get error on switch case. this is the error message "Constant expression required"
Same error for me
Use if else instead of a switch case.
Thank you ❤️
:-)
I have Error at the style tag "Element style must be declared" , at 03:50
Please check the below link:
stackoverflow.com/questions/20790708/element-must-be-declared-error-for-tag-shape
As an iOS developer I really hope that's not the way it needs to be done on Android!
I have mentioned in the video that bottom navigation with activities is not a recommended way instead use fragments.
This video is just for an experimental purpose :-)
"bottom_menu" is empty in design. how can i solve this?
Same problem
Thank you
How to show text under home icon , search icon, settings icon
Set labelVisibilityMode as "label" in activity _main.
@@android_knowledge and how to change the text colour ??
@@Sk_earningOfficial-1 Item text color
tysm man
Source code ?
I have added source code in the description box, please check :-)
I have error on the switch case id
Please use if else instead of switch case.
5:34 item_selector