People Askng, Error Binding..! [here solve that i created to u] ViewBinding is only available from Android Studio 3.6 and above 1:- You need to upgrade your gradle build toold to 3.6.1 in build.gradle (Project level) dependencies { implementation 'com.android.tools.build:gradle:3.6.1' } 2:- You need to enable viewBinding in build.gradle(app) android { viewBinding { enabled = true }} in the end u can binding , easy way : public class AddItemActivity extends AppCompatActivity { private AddItemActivityBinding binding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = AddItemActivityBinding.inflate(getLayoutInflater()); View view = binding.getRoot(); setContentView(view); //now we can access views by their IDs binding.tvTitleMyOrder.setText("Title goes here"); } } ,,, hit like if it helps u. thx
Great video, was very helpful for a project I am working on. I am currenty trying to learn how to work with realtime databases within firebase and was wondering how to go about adding features within my app to fragments, such as a login fragment or a view profile information fragment. Thanks again for the great tutorial!
Thanks for this video....can you tell me how to deal with menu item id warning and how you can go to homepage if you are on another fragment ... and i see menu item warning in new versions of android studio hope to make video for changes in news update
2:18 android:layout_width="match_parent" android:layout_height="match_parent" Don't change them to 0dp, that's why I had a white screen just don't change the text in these lines
Thanks a lot!! This video has helped me a lot. It's really easy to follow, great explanations Please make a tutorial on how to use this bottom navigation bar with nav component as well.
Hey its a very great video, it helps a lot but I got a query. I have followed your video yet my bottom navigation bar does not shows any icon or name, it is just a blank bar. Can you help me with it.
same here bro. I have been trying to create a bottom navigation bar for last two days and I am still unable to do it. The navigation bar doesn't show any icon, its just get blank. if u have got the solution pls help me out bro
My navigation bar has 5 items, with a home item in the middle. I want my app to show the home screen when it is opened, which it currently does so, however the navigation bar doesn't highlight the home icon, instead it highlights the icon furthest to the left. How can I change this?
hi, I did all the steps exactly in the video but when i add app:menu="@menu/bottom_nav_menu" , the design pages disappear and I get an error like this : failed to instantiate one or more classes. what should i do ?
Sir, I wanna ask, why if I click little bit fast between menu button on bottom navigation, the app will crash. Logcat said fragment is not attached on activity. But if I click it slowly, there is no crash. It's seem that the activity lost the fragment because switch too fast. In each fragment loads data in recycler view. Could you give any solution about it?
How to add multi-language support? There is a lot of videos on youtube but they use only activity for multi-language support not fragment so how we implement multi-language support on activity as well as fragments?
Great Tutorial....But my questions is where is that frame_layout been initialized until you used it on your mainActivity.I will appreciate your feedback
Awesome Videos Bro 👍👍 I Appreciate Your Perfect Tutorials. I Am New To App Development And Learning Could You Please Explain Me or Maybe Make Video or Help With The Code With The Following Things !! Let's Say I Have Created An App Example MyApp (Using Java) Can You Please Tell Me How To Achieve The Following Two Things : 1st - Click On MyApp Icon Opens Another App (Any Other Given App) Without Opening My App ( I Can Achieve This If I Choose To Open My App First Than It Wll Call Another App) But I Don't Know How To Achieve This Without Opening My App At All ??? 2nd - I Want To Keep This App Running In The Background Most Of The Times If Not Always ( Without Foreground Service ) ???
@@samuelkioko2312 You need to change on line 16 ActivityMainBinding with ActivityClassNameBinding. ClassName is the name of the activity where you write the code.
sir i followed the same but its not recognizing the id....(i put the correct id name).......Actually not doing in the main activity created an activity named as home....i want to display my bottom nav over there .....idk why its not able to fetch the id wich is stored in menu ...... please help
Hi! I got a similar problem. The binding class name has to match the name of the activity where you want to put the bottomNavBar in. For example: if you use the bottomNavBar in HomeActivity, the binding is ActivityHomeBinding. All these binding classes are dynamically generated when you create a new activity with the help of " java reflection". Btw, I had another problem, maybe will help you too :D : my fragments were invisible, because the framelayout(in the activity's XML) had width and height set to 0dp. I had to modify them to a grater size and then BOOM, they appeared. :D Good luck!
hello brother! firstly thank you for this excellent tutorial! I can connect end-to-end with this! thank you again, since I am new to Android Studio, I'm learning this in java, and you provide this in kotlin, so what's your suggestion regarding this, should I go with both at the same time or separately?
binding.bottomNavigationView2.setOnItemSelectedListener(item->{ ^ symbol: variable bottomNavigationView2 location: variable binding of type ActivityMainBinding how to overcome this errer
sir you make BottomNavigationBar with the help of SetOnItemSelectedListener, switch statement and one user defined function (replaceFragment). So, my question is that there is also another way of creating BottomNavigationBar with the help of NavHostFragment and Nav Controller? kindly make a video on it? tell us which way of making BottomNavigationBar is more efficient? Thank you
Hi! I got a similar problem, I hope I understood yours right. The binding class name has to match the name of the activity where you want to put the bottomNavBar in. For example: if you use the bottomNavBar in HomeActivity, the binding is ActivityHomeBinding. All these binding classes are dynamically generated when you create a new activity with the help of " java reflection". Good luck!
binding.bottomNavigationView.setOnItemSelectedListener(item -> { switch (item.getItemId()){ case R.id.bangtin: replaceFragment(new Fragment1()); break; case R.id.sotay: replaceFragment(new Fragment2()); break; case R.id.xemsau: replaceFragment(new Fragment3()); break; } return true; }); why case R.id.bangtin,R.id.sotay,R.id.xemsau plz help me
It gives me an error 😭 from minute 6:41 my ActivityMainBinding appears in red... why???
Did you do the Gradle synchronization? It might help. You will see a prompt near the top, asking to do a Sync
People Askng, Error Binding..! [here solve that i created to u]
ViewBinding is only available from Android Studio 3.6 and above
1:- You need to upgrade your gradle build toold to 3.6.1 in build.gradle (Project level)
dependencies {
implementation 'com.android.tools.build:gradle:3.6.1'
}
2:- You need to enable viewBinding in build.gradle(app)
android {
viewBinding {
enabled = true
}}
in the end u can binding , easy way :
public class AddItemActivity extends AppCompatActivity {
private AddItemActivityBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = AddItemActivityBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);
//now we can access views by their IDs
binding.tvTitleMyOrder.setText("Title goes here");
}
}
,,, hit like if it helps u. thx
thank you so much i tried multiple ways to do a navigation bar but none of them worked except yours thank you so much
man you solve my problem with fragments and how clickes works on it thx for your time
Thank you so much for this. I am starting my final project in college and am admittedly in way over my head. This helped clear things up a lot
Glad it was helpful!
Thank you for this video! I didn't know to use this type of fragments and I needed for my final course project. It was very helpful.
Thank you a lot. I like your way of teaching.
Thanks man that's a lovely video I'm stuck for morning but now error is resolved🌟👍
Glad it helped!!
Thank you very much, this is very helpful for my project.....
Thanks for this help full tutorial bro
thanks a lot that was very helpful may god bless you
Thanks so much.. The video really helped me to achieve it easily
Great video, was very helpful for a project I am working on. I am currenty trying to learn how to work with realtime databases within firebase and was wondering how to go about adding features within my app to fragments, such as a login fragment or a view profile information fragment. Thanks again for the great tutorial!
Thank you!! Very easy to follow and thank you for the explanations!
Thanks sir! Big help for my upcoming project!
Thanks for making this video, really helped me
Does not work, when i run my app it wont show the new fragments and just a navbar at the bottom
Thanks for this video....can you tell me how to deal with menu item id warning and how you can go to homepage if you are on another fragment ...
and i see menu item warning in new versions of android studio hope to make video for changes in news update
You are the best!!! Thank you!!!
The binding part did not work on my pc. Don't know why.
Build -> Clean Project
Build -> Rebuild Project
then try again
:)
Same for me. Clean/Rebuild also doesnt work.
Line 19, binding is not working
Same didn't work it
Thanks for helping me
my gradle project cant sync! idk whats the problem, need helpppp
Thank you for that, you really helped me!
Great video
But when I am selecting fragment it is not showing text or background colour it is only blank
What should I do
thank you ,very helpful
My fragments are not replacing :(
Mine too
Thanks for information 👍
2:18
android:layout_width="match_parent"
android:layout_height="match_parent"
Don't change them to 0dp, that's why I had a white screen
just don't change the text in these lines
thanks..this comment helped me
wow, thanks! it helped me a lot
Why binding is not working in my code ??
Thank you so much!!!!!!!!
Thank you so much
Thanks a lot!! This video has helped me a lot. It's really easy to follow, great explanations
Please make a tutorial on how to use this bottom navigation bar with nav component as well.
Hey its a very great video, it helps a lot but I got a query. I have followed your video yet my bottom navigation bar does not shows any icon or name, it is just a blank bar. Can you help me with it.
Change the theme in your themes.xml
same here bro. I have been trying to create a bottom navigation bar for last two days and I am still unable to do it. The navigation bar doesn't show any icon, its just get blank. if u have got the solution pls help me out bro
@@azizboukhchim4818 bhai help kar de thoda. pisle do dino se mera bhi same problem hai, theme mein kya settings krna hoga yeh bhi bata de zara
Go to file > Project Structure > Dependencies > app > material:1.5.0, change the requested version to 1.4.0
@@YK-zz4th
if we want to add the bottom layout to the app, then do we have to do this thing to this for all activities?
Please make your videos with white background as it's get easy to read.
Your content is very useful for me. Thank you sir.
Thanks for the feedback!!
There is no audio during a large part of the video!!!
My navigation bar has 5 items, with a home item in the middle. I want my app to show the home screen when it is opened, which it currently does so, however the navigation bar doesn't highlight the home icon, instead it highlights the icon furthest to the left. How can I change this?
thanks👍
thank you for the video how about instead of fragments the activities would be loaded
hi, I did all the steps exactly in the video but when i add app:menu="@menu/bottom_nav_menu" , the design pages disappear and I get an error like this : failed to instantiate one or more classes. what should i do ?
Great video
great video helped me a lot, it would be nice if you made a drawer menu in this project, thanks in advance
Nice introo
Thank You..!
Hi. How to write a function that clicks at x = 100, y = 100 on a smartphone in android studio? Without touching the screen.
You can do it easier with the navigation folder, just make the menu is same fragments id 🎉
when I remove appbar by doing noactionbar in theme ,,the bottom navigation bar color changes what should I do
Sir, I wanna ask, why if I click little bit fast between menu button on bottom navigation, the app will crash. Logcat said fragment is not attached on activity. But if I click it slowly, there is no crash. It's seem that the activity lost the fragment because switch too fast. In each fragment loads data in recycler view. Could you give any solution about it?
Thanks you sir I needed it so bad
Glad it helped!!
Thank you so much Sir
I have added custom .xml file for toolbar, when I add FrameLayout it hides the toolbar of my app, wht to do??
Great video! :D
Thanks!
why when I change the orientation of the cell phone to horizontal it returns me to the "home" fragment?
This tutorial is slightly outdated: you won't be able to compile it unless you change the switch-case to an if-else.
How to change the icon color? While tap that icon turn into orange from black
How to add multi-language support? There is a lot of videos on youtube but they use only activity for multi-language support not fragment so how we implement multi-language support on activity as well as fragments?
thank you for the tutorial but theres an error "unexpected return value" any idea how to fix it? tq in advance
hello.
how to enable shift animation, when the selected element shifts the rest?
constant expression error while compile
???? help out plz
8:14 I get "Constant expression required" error :/
bhai android ka complete syllabus kab leke aoo ge plzz make a video on it
thank u brother
hi. why does my navigation bar go missing after i click on each icon?
How can I add Activity in place of first fragment?
Great Tutorial....But my questions is where is that frame_layout been initialized until you used it on your mainActivity.I will appreciate your feedback
That was on activity_main.xml
When I run the emulator then I am on a empty activity I first need to click on home then im on fragment someone know why?
Hey ..i was following your video" how to add search view in recycler view with kotlin" but i wanna know how can i add it inside fragment using kotlin
Awesome Videos Bro 👍👍
I Appreciate Your Perfect Tutorials. I Am New To App Development And Learning Could You Please Explain Me or Maybe Make Video or Help With The Code With The Following Things !!
Let's Say I Have Created An App Example MyApp (Using Java)
Can You Please Tell Me How To Achieve The Following Two Things :
1st - Click On MyApp Icon Opens Another App (Any Other Given App) Without Opening My App ( I Can Achieve This If I Choose To Open My App First Than It Wll Call Another App) But I Don't Know How To Achieve This Without Opening My App At All ???
2nd - I Want To Keep This App Running In The Background Most Of The Times If Not Always ( Without Foreground Service ) ???
Dev ?? 👻 Else
love you boss
Perfect!
Thank you liked yo video
when i have created binding variable in some other class except MainActivity, the id of the bottomNavigation is not able to search
Same case.. You managed to solve? How?
@@samuelkioko2312 You need to change on line 16 ActivityMainBinding with ActivityClassNameBinding. ClassName is the name of the activity where you write the code.
@@stefania3582 thank u
@@stefania3582 for ex my activity name SecondActivity, so i change it with ActivitySecondActivityBinding like that, isn't true ?
@@NguyenTuan-pu7ye yes
and now, the 1000 likes
can we use constraint layout instead of Framelayout ?
Anyway you are going to replace it with fragment any particular reason?
Having issues with the viewBinding in the build gradle module. Seems my android studio doesn't recognize that code
make sure you press sync in the top right hand corner after changing the gradle code. I had the same problem
@@trumanyen1544 thank you
viewBinding not found how to fix?
My bottom navigation view is all blank. No icon there. Anyone knows how to solve it?
sir i followed the same but its not recognizing the id....(i put the correct id name).......Actually not doing in the main activity created an activity named as home....i want to display my bottom nav over there .....idk why its not able to fetch the id wich is stored in menu ...... please help
Hi! I got a similar problem. The binding class name has to match the name of the activity where you want to put the bottomNavBar in.
For example: if you use the bottomNavBar in HomeActivity, the binding is ActivityHomeBinding.
All these binding classes are dynamically generated when you create a new activity with the help of " java reflection".
Btw, I had another problem, maybe will help you too :D : my fragments were invisible, because the framelayout(in the activity's XML) had width and height set to 0dp. I had to modify them to a grater size and then BOOM, they appeared. :D
Good luck!
@@corinagherasim3340 tysm i tred this they both are same ...n m working on activity
Watch this video with full audio at this link ruclips.net/video/jOFLmKMOcK0/видео.html
hello brother! firstly thank you for this excellent tutorial! I can connect end-to-end with this! thank you again, since I am new to Android Studio, I'm learning this in java, and you provide this in kotlin, so what's your suggestion regarding this, should I go with both at the same time or separately?
Do you have kotlin version for this
Will upload soon
Can’t find buildFeature??
binding.bottomNavigationView2.setOnItemSelectedListener(item->{
^
symbol: variable bottomNavigationView2
location: variable binding of type ActivityMainBinding how to overcome this errer
sir you make BottomNavigationBar with the help of SetOnItemSelectedListener, switch statement and one user defined function (replaceFragment). So, my question is that there is also another way of creating BottomNavigationBar with the help of NavHostFragment and Nav Controller? kindly make a video on it? tell us which way of making BottomNavigationBar is more efficient? Thank you
For me first icon alone not showing sir... kindly help me sir
DM your code pics on IG
Muito obrigado!
How do you do this if you have another activity??? In between
Do you have solutions after 2 weeks? haha, cause im in trouble now
Hi! I got a similar problem, I hope I understood yours right. The binding class name has to match the name of the activity where you want to put the bottomNavBar in.
For example: if you use the bottomNavBar in HomeActivity, the binding is ActivityHomeBinding.
All these binding classes are dynamically generated when you create a new activity with the help of " java reflection".
Good luck!
veiwBinding not found
Audio nahi atta dich me
My app is crashing
same, have you found a solution ?
not working, waste of time :
Apko video bnana ata ho to hi bnao
13 minutes
Araaam se kr bhai saans to lene de be
Not a good idea to follow this video in 2022.
Pahele edit karna achese
Click on the pinned comment with full audio
binding.bottomNavigationView.setOnItemSelectedListener(item -> {
switch (item.getItemId()){
case R.id.bangtin:
replaceFragment(new Fragment1());
break;
case R.id.sotay:
replaceFragment(new Fragment2());
break;
case R.id.xemsau:
replaceFragment(new Fragment3());
break;
}
return true;
});
why case R.id.bangtin,R.id.sotay,R.id.xemsau plz help me
replace switch method by if, else if statements method !
i cant extract when i run the code and this is will show up
Can not extract resource from com.android.aaptcompiler.ParsedResource@4b038330.
Thanks for information 👍