Bottom Navigation With Activities in Android Studio | BottomNavigation | Android Coding
Вставка
- Опубліковано 19 вер 2024
- Bottom Navigation Tutorial : In This Video, You Will Learn How to Integrate Bottom Navigation With Multiple Activities in Android Studio.
Build.Gradle :
implementation 'com.google.android.material:material:1.0.0'
All File :
1) activity_main.xml 2) MainActivity.java
3) activity_dashboard.xml 4) Dashboard.java
5) activity_about.xml 6) About.java
7) selector.xml 8) menu_navigation.xml
Table Of Content :
0:23 - Project Creation
0:43 - XML Code
6:36 - Java Code
10:17 - Output
Presented By : Android Coding
Background Music By : NoCopyrightSounds
Download Apk Link :
drive.google.c...
All My App Links :
1) QR Scanner App : bit.ly/ScannerA...
2) Colors Code App : bit.ly/ColorsCode
3) Age Calculator App : bit.ly/AndroidA...
Enjoy & Stay Connected With Us!
► Subscribe To Android Coding : bit.ly/UA-cam-...
► Like Us On Facebook : bit.ly/Facebook...
► Follow Us On Instagram : bit.ly/Instagra...
► Follow Us On Twitter : bit.ly/Twitter-...
#BottomNavWithActivities #AndroidTutorial #12H1r
Follow Flutter Coding :
ua-cam.com/channels/W_GrcJ80QLBakAATLcvXpg.html
Thank you, this was the only tutorial that worked out of so many!
Welcome
Exactly what the title says and exactly what I needed. This is a lifesaver.
Thank you very much for making this video.
Thanks for appreciating my work. You're welcome.
Thank you sir it is very helpful
You're welcome
Exactky what i needed!!! Simple, no need of a ton of code and does the job wonderfully!!
Thanks for appreciation.
Thank you very much sir for making amazing video 🙂
You're welcome
Thank you for the amazing video!! You not only solved my issues but you also improved my coding efficiency :). Keep up the great work!!
Very nice bro keep it up
Thank you
finally been looking for this, i dont really understand fragments good thing you material design
Thanks
Awesome
Thanks
Thank you SO much!
All the way from South Africa 🇿🇦
You're welcome
Thanks friend. 🌹😎
Welcome 👍
Thank You very much
You're welcome
nice bro thanks for sharing your knowledge
This is what i needed, thank you a lot :D
You're welcome.
Thank you. I checked various videos to learn how to work in android. Yours is best. Thank you, Ur videos helped a lot. Make more videos.
Welcome. It's my pleasure. Keep supporting.
Thank you very very MUCH!!!!!!!!!!!!!
Probably the easiest way! 🤩🤩😃😃😌😌
Your Welcome
💙you saved my day
Glad to help.
Thank you man! This worked great, it really helped me a lot
You're welcome
you are the best professor
Thanks a lot. Glad to hear.
setonnavigationitemselectedlistener is now deprecated use NavigationBarView.setOnItemSelectedListener it will work.
Overall it was a very good and helpful Video
Thanks
bro how to solve this issue?
your almost all tutorials helps me a lot
and in every tutorial change background music
Best method 👍👍👍
Thank you a lot! This really helped me!
You're welcome. Keep learning.
Thanku so much...
Welcome
thanks a lot
You're welcome
this one actually helped me, thanks!
You're welcome
thank u sooo much
You're welcome
thank you really much this is a really good way to avoid the fragments
i agree too
Welcome
Im a beginner, why should we avoid fragments ?
I'm curious because with activities I've found some bad points:
- it seems slower
- when we spam navigation buttons the pending transition shows up again
- repetition of code
- tabs stack for the back button
Thank u so much!
You're welcome
Thanks for your knowledge, your channel was the best I've seen so far. Congratulations on not making a channel with all this content in kotlin ???
thank you bro you are the best bro
You're welcome. Thanks for appreciation. Keep learning.
Thank you so much! You're the best
You're welcome
thanks a lot of . It's work . And Also You solve my change activity transistarion problem . Thanks
Thank you bro, really good, just I have a question, may I know why do you prefer to not use constraint layout?
Thank you again.
Because constraint layout has many disadvantages bottom but we can use even with it .I did it
@@karruramesh9798 it doesn't work for me bro can u explain to me
nice tutorial, very useful for me
Thanks
Thanks! This video helped me so much.
You're welcome. Keep learning.
very helpful video.Thank you!!
You're welcome
amazing job! thank you so much
You're welcome
great example! a ton of thanks dude
Welcome
Thank you so much :)
굿....나이스.... good . nice video.. thank you
Thanks. You're welcome.
Useful thanks
Welcome
woww thanks for your tutotial its done
Thank you for this video... but in this video there is OnNavigationItemSelectedListener() used in MainActivity so i am doing it same but its showing error that it cannot be used, can anyone help ? @AndroidCoding
Thanks sir
Welcome
Thanks a lot ❤
You're welcome.
kind of useful
Good and clear tutorial!
Do you think that it is better navigation with activity or fragment?
Thanks for appreciation. I think fragment is better.
Thanks bro.
Welcome
now im looking for tutorial on how to except the navigation bar on scrolling
Try this :
ua-cam.com/video/AYSlm-KXlQE/v-deo.html
Man, thank you so muchh!
Welcome
Thanks
Welcome
hello sir, nice tutorial here. But the problem with this is when you go to other activity and then go back (backPressed or finish) , the selectedIndex does not change as per the code , and changing it in the above mentioned methods would not help either, so do you have any specific way that could help? Thanks in advance.
thanks bro, greetings from Peru
You're welcome
Very good
Thanks
Thank you.
Thank you, I've been looking for similar code, but I only found for fragments, and was relatively frustrated.
I was looking for a kotlin code, but your Java code was easy to "translate" into kotlin.
Thanks again, you really saved me, I was desperate!
You're welcome. Glad to hear.
Hey, do you have the kotlin code?
Hey. You can convert java to kotlin.
@@AndroidCoding yes but for this i need to import de whole code in kotlin and i haven't it
@@AndroidCoding You haven't the code in Kotlin right?
Hello sir 😊 please make a video to save the data onto Farebase and also make a video for basic functions such as (Add, Update, Deleted, and Search). Lastly is, all the data has been save to the Farebase can we see/view from separated navigation/menu.
Try this :
ua-cam.com/video/aQ7MGoMNBik/v-deo.html
this works but its is not advisable to use, because all you just did was open multiple activities, those Activities are still running in the back ground because u didnt close them after opening them.
to test run your error try clicking the home button multiple times
then press back on your android phone...it doesnt return to your menu
hello bro i m new to android ,,,,,,,some people do this things from fragments and some with activities which is best
Use Fragments When using navigation drawers and all.. Coz its kind of lightweight compared to a new activity.. Read online. Not completely sure👍
Sir the onNavigationSelectedListner method is deprecated now so please help me to find a better alternative also If possible then Please update this video
Ok. I will try to make a video on this topic.
@@AndroidCoding please tell me what I do now?
Try this :
bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { int id = item.getItemId(); switch(id){ //check id } return true; } });
@@AndroidCoding god bless yo.Wasnt sure about this but it really worked
Thanks!!!
do you have upload video for buttom navigation menu with fragment?
thank you for your time
Check this :
ua-cam.com/video/mrgs6IWbZ3k/v-deo.html
you're cool, bro !)
Thanks bro
BottomNavigationView is not working for me
Please help me. Here is my error: attempt to invoke virtual method 'void com.google.android.material.bottomnavigation.BottomNavigation.setSelectedItemId(int)'
When clicking home twice, a black screen comes up.
Super broo... if possible can you make the video in sqlite in android
Hey, this was helpful.. Coming a bit late, but would you happen to know how to change the background color of the active item? I know how to change the icon color (I've hid the labels), but I don't know how to change the background without messing with the drawables.. If you have any idea it would be much appreciated, thx.
selector.xml is not working. :(
anyways great video
Thanks
Please, How to implement recycler view at this? (bottom navigation)
sir your method is very good, but it is not woking with " on back press " there are threee activities in your app dashboard, home and about. while my app is open from dashboard i select home and then i select about. when i press "on back press button" the activity is come back into home but the icon state not change. I am using and when i again press " on back press button" it come back to dashboard and icone state come into home. I want that when I am in about activity and i press on back press button then the button state also change to previous button. can you help me with this?
Thanks for appreciation. I will make a video on this topic later. But it's possible only when you're using fragment.
@@AndroidCoding okay. thanks for your reply.
Welcome
Why you add meterial version? Plz describe?
What is material version?
What you do in module settings?
Hello. may I ask you a question? between bottom navigation with activities and bottom navigation with fragment, which one is better?
It works BUT the colors of the text of menu is pink and i do not have a changing color from black to white when selecting other menu. HELP PLEASE!
Try this :
res/drawable/color_selector .xml:
@@AndroidCoding Thank you Brother, but it does not work. In your code it is coloR instead of colo. I changed that but I have the same pink color text. Do you have an idea how to fix that? Thanks bro :)
I got error in boolean type methods .how to resolve this error
me too;(
Any solution? :((
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
//Your Method
return false;
}
});
Hello, I would like to ask why there is a splash screen when switching between activities, unlike the animation in your video that does not directly switch
My navigation is not aligning horizontal when I set align parent bottom to true but it is aligning vertical on top of one another. It is the at the bottom but just not horizontally. How do I fix this?
the navigation bar doesn't show up, it worked on my other app but not on this one, i followed everything but it doesnt work, checked gradle file too and idk whats the matter, do i need a different material version?
I need to click twice to open a page from navigationview.. Can anyone help me to click it once and open it?
You can use handler to achieve this.
Watch this :
ua-cam.com/video/4ZOUZQ5FUns/v-deo.html
@@AndroidCoding Thankyou ❤️
You're welcome
thanks bro
if make music player sound in app 5 file sound in assets or raw and show by listview and when click on play sound and have button play pause with seekbar ..
Hi bro I have a problem the title what you defined in menu for all the vector imges title didnt come until if i clicking on bottom button if I click on button than title show plz tell me how I can get out of this issue ?
hye brother i need help about navigation icon can you help me please i stack on on little error
For any queries direct message on Instagram.
thank you so much, an amazing tutorial!!!!!!!!!!!!!!!!!
Welcome
Hi can you please help me? It is that the overridePendingTransition(enterAnim: 0, exitAnim: 0); is not working correctly in my code.
Hi, I am not able to switch to another activity , when I put boolean return type of OnNavigationItemSelected then it gives me and error. Please help me.
use com.google.android.material 1.0.0
Hello.
How to enable shift animation, when the selected element shifts the rest?
Why does the activities keep piling up? When I tap the back button, it returns to the previous open activity. how to fix it so that if the user tap the back button it will show a dialog where its says it exit the app?
Help me
Bro please upload side navigation drawer video
Check this link :
ua-cam.com/video/s531hc97z2A/v-deo.html
please explain what are you doing in video . then everyone can understand it
I got error can you guys help me?
at com.example.futuredream.Tab2.onCreate(Tab2.java:19)
when i click the option tab layout the apps is force close
you should have to use of fragments instead of activities.. so you'll not copy paste again the same code in every activity..
How if i want input rycycle in gallery activty?
java part coding not working for me dont know why but BottomNabigationView keep on getting RED
Send me screen shot on Instagram or Facebook.
Sir, why i get android resource linking failed error? Pls help, thanks.
How did you slove it
@@HussainAli-sg2kb ua-cam.com/video/JT8jKshHVXU/v-deo.html i use this, bottom navigation with fragments.
Hello there.....i was wondering if you could help me with this problem I'm having. So i added a button on the dashboard activity i tried to add a function to that button on my java code but findviewbyid doesn't work ...... please help ❤
Would've been better if you explained what you are doing and why. I just started learning Java 3 months ago and I don't understand what you are doing. It is just copy pasting somebody elses code. Im not learning anything here. No explaination whatsoever.
Ok i will try to explain but it will take some time.
I still have a title bar at the top on all activities except activity_main. Does anybody know why?
bro help me bro
my code does not showing any errors still bottom Navigation its not displaying in screen
plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me bro
Send me the code on instagram.