@@mollyolly3173 I aslo used "if" statement. But now I'm facing the lag issue. Means whenever i click on the bottom navigation item, it shows a little bit of lag on the item icons. I have created custom designs for my fragments and i think the issue is that whenever i click on the navigation bar item, the view of the fragment is being created again and again which is causing the lag. "Sorry for my bad English"
@@Has_san03 I have the same problem) but my professor didn't notice it so I moved on to other tasks and i don't know how can i help you, sorry. I'm not an English speaker either, but your English is good
@@mollyolly3173 I have showed this to my professor and he told me that your fragment's view is being created again and again whenever you click on the item which is causing lag. I asked chatgpt to solve this problem and after using his methods the lag decreased too much but still there's a little bit of lag.
i solved the problem navigationView.setOnItemSelectedListener(new BottomNavigationView.OnItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { Fragment fragment = null; switch (item.getItemId()){ case R.id.nav_home: fragment = new HomeFragmant(); break; case R.id.nav_stats: fragment = new StatsFragmant(); break; case R.id.nav_settings: fragment = new SettingsFragmant(); break; case R.id.nav_calender: fragment = new CalenderFragment(); break; } getSupportFragmentManager().beginTransaction().replace(R.id.body_content, fragment).commit(); return true; } });
In the MainActivity, setOnNavigationItemReselectedListener instead of being public boolean, I get void by default, any help with that? (With void I have to double click to enter the Fragment)
Add this dependency and syn your project implementation 'com.google.android.material:material:1.3.0' after complete syncing restart your android studio if you still getting the same problem message me on telegram
Highly good your are professional android programmer ;)
can u do that but for kotlin?
thanks! it's really helpful
plz help. How to see the selected item page of the navigation drawer menu? its not going anywhere on clicking the items.
The same with me
17:34/ where this Id.
"body_container" came from?
Menu file
None less than the Magic!!
Thank you so much sir 💕
What if we want to switch activity instead of fragment ? please answer.
thank you! find hide statusbar!
So where is the part of the video where you show us your code actually running and working?
All you show us is that your code compiled successfully.
Bro excelente video, me suscribo 👌🏻
bro it always says error in attr bro , can you help me fixing this?
help me, I can't figure out what the error is error: constant expression required
case R.id.home:
Got the same error in the switch case. Still can't find any solution
@@Has_san03 I used "if" instead of "switch"
@@mollyolly3173 I aslo used "if" statement. But now I'm facing the lag issue. Means whenever i click on the bottom navigation item, it shows a little bit of lag on the item icons. I have created custom designs for my fragments and i think the issue is that whenever i click on the navigation bar item, the view of the fragment is being created again and again which is causing the lag.
"Sorry for my bad English"
@@Has_san03 I have the same problem) but my professor didn't notice it so I moved on to other tasks and i don't know how can i help you, sorry. I'm not an English speaker either, but your English is good
@@mollyolly3173 I have showed this to my professor and he told me that your fragment's view is being created again and again whenever you click on the item which is causing lag. I asked chatgpt to solve this problem and after using his methods the lag decreased too much but still there's a little bit of lag.
its not working bro
Bro i follwed everything but not while doing switch case it is not recognize menu_home id ...
as well as this code has deprecated methods
help!!
i have the same problem
i solved the problem
navigationView.setOnItemSelectedListener(new BottomNavigationView.OnItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Fragment fragment = null;
switch (item.getItemId()){
case R.id.nav_home:
fragment = new HomeFragmant();
break;
case R.id.nav_stats:
fragment = new StatsFragmant();
break;
case R.id.nav_settings:
fragment = new SettingsFragmant();
break;
case R.id.nav_calender:
fragment = new CalenderFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.body_content, fragment).commit();
return true;
}
});
thanks a milion man
friends video 12.23 to 14.05 stopped here. so skip that time.
Item menu not displaying in bottom navigation view
What is the music for !
Thanks to share this material :) !! I already follow you!!
Maybe can someone put his complete bild.gradle app Code herein I fucked it and cant find mistake
16:17 where this ID "nav_home" came from?
Do menu
Thanks man..
wrote 2021 method looks
of 20011
Thank you so much bhai....
Subbed u
Can u please make a vdo on implementation of
ChipBottomNavigation
BubbleBottomNavigation
Java only
Please?
Pls give code
Hello,
I followed the tutorial but when I select a button, the color of the button don't stay black can you help me ?
In the MainActivity, setOnNavigationItemReselectedListener instead of being public boolean, I get void by default, any help with that?
(With void I have to double click to enter the Fragment)
Add this dependency and syn your project
implementation 'com.google.android.material:material:1.3.0'
after complete syncing restart your android studio if you still getting the same problem message me on telegram
@@codewithnitish5208 Oh, my friend. I had put onNavigationItemReselected
instead of onNavigationItemSelected, thanks anyway!
Sir
Dependencies please
Dependencies ke bina ye kaam run nahi ho raha he sab jagha error aa raha he.
which Dependencies do you want?
@@codewithnitish5208 Dependencies me jo link past karte he vo nahi di aap ne
@@kundalikrathod2113
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
mainey is project mai sirf ye dependancy use kiya tha
@@codewithnitish5208 aap ka WhatsApp Number, Telegram.. Dijiye sir
the f this video is not working
i think you didnt watch the video correctly for me it worked
@@debanjan_saha listener is deprecated, video is not working
wtf is this music
Fast
Reply