Bottom Navigation Bar - Android Studio | Fragments | Java | 2022

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • НаукаНаука

Комментарии • 145

  • @MARTANEGROL4B
    @MARTANEGROL4B 2 года назад +4

    It gives me an error 😭 from minute 6:41 my ActivityMainBinding appears in red... why???

    • @turcinjsh
      @turcinjsh 2 года назад +4

      Did you do the Gradle synchronization? It might help. You will see a prompt near the top, asking to do a Sync

  • @i.a9184
    @i.a9184 2 года назад +4

    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

  • @joharah1420
    @joharah1420 2 года назад

    thank you so much i tried multiple ways to do a navigation bar but none of them worked except yours thank you so much

  • @mohamedQ
    @mohamedQ 2 года назад +1

    man you solve my problem with fragments and how clickes works on it thx for your time

  • @EmilWelton
    @EmilWelton Год назад +1

    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

  • @IsaacJoestar
    @IsaacJoestar Год назад

    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.

  • @EchoENKO
    @EchoENKO 9 месяцев назад

    Thank you a lot. I like your way of teaching.

  • @yashsharma8875
    @yashsharma8875 2 года назад +1

    Thanks man that's a lovely video I'm stuck for morning but now error is resolved🌟👍

  • @asithaindrajith8818
    @asithaindrajith8818 Год назад

    Thank you very much, this is very helpful for my project.....

  • @clevercodeverse993
    @clevercodeverse993 2 года назад +1

    Thanks for this help full tutorial bro

  • @awosal-radaidehx5006
    @awosal-radaidehx5006 2 года назад +1

    thanks a lot that was very helpful may god bless you

  • @joelsilva232
    @joelsilva232 Год назад

    Thanks so much.. The video really helped me to achieve it easily

  • @maul_grab
    @maul_grab 2 года назад +4

    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!

  • @dnngyn
    @dnngyn 2 года назад +2

    Thank you!! Very easy to follow and thank you for the explanations!

  • @canacojenrykim5777
    @canacojenrykim5777 2 года назад

    Thanks sir! Big help for my upcoming project!

  • @oberlexia
    @oberlexia Год назад

    Thanks for making this video, really helped me

  • @Stella_8008
    @Stella_8008 2 года назад +6

    Does not work, when i run my app it wont show the new fragments and just a navbar at the bottom

  • @قناةالرياضيات-ن7ر
    @قناةالرياضيات-ن7ر 2 года назад +1

    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

  • @alecsandroh
    @alecsandroh Год назад

    You are the best!!! Thank you!!!

  • @simonamatiukaite2198
    @simonamatiukaite2198 2 года назад +13

    The binding part did not work on my pc. Don't know why.

  • @nahian.66
    @nahian.66 2 года назад +1

    Thanks for helping me

  • @sebastianfernandezconde53
    @sebastianfernandezconde53 2 года назад +1

    my gradle project cant sync! idk whats the problem, need helpppp

  • @user-pt1zt1qc2v
    @user-pt1zt1qc2v Год назад

    Thank you for that, you really helped me!

  • @anuptarone3387
    @anuptarone3387 2 года назад +2

    Great video
    But when I am selecting fragment it is not showing text or background colour it is only blank
    What should I do

  • @kennedylinzie8663
    @kennedylinzie8663 2 года назад +1

    thank you ,very helpful

  • @joanagomes635
    @joanagomes635 2 года назад +5

    My fragments are not replacing :(

  • @sjjayaswal7621
    @sjjayaswal7621 2 года назад

    Thanks for information 👍

  • @V1337adim
    @V1337adim 2 года назад +8

    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

  • @ankitjha6547
    @ankitjha6547 2 года назад +1

    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.

  • @calmlife18
    @calmlife18 2 года назад +3

    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.

    • @azizboukhchim4818
      @azizboukhchim4818 2 года назад +1

      Change the theme in your themes.xml

    • @GhostRide730
      @GhostRide730 2 года назад

      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

    • @GhostRide730
      @GhostRide730 2 года назад

      @@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

    • @YK-zz4th
      @YK-zz4th 2 года назад +4

      Go to file > Project Structure > Dependencies > app > material:1.5.0, change the requested version to 1.4.0

    • @jungho6048
      @jungho6048 2 года назад

      @@YK-zz4th

  • @ameykulkarni1742
    @ameykulkarni1742 Год назад

    if we want to add the bottom layout to the app, then do we have to do this thing to this for all activities?

  • @its_Akash_
    @its_Akash_ 2 года назад +2

    Please make your videos with white background as it's get easy to read.
    Your content is very useful for me. Thank you sir.

  • @h.eh.2813
    @h.eh.2813 5 месяцев назад +1

    There is no audio during a large part of the video!!!

  • @aidenbrooks9454
    @aidenbrooks9454 Год назад

    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?

  • @amirhosainarabzade5990
    @amirhosainarabzade5990 2 года назад +1

    thanks👍

  • @zeris3134
    @zeris3134 2 года назад +1

    thank you for the video how about instead of fragments the activities would be loaded

  • @tugbaylmaz2448
    @tugbaylmaz2448 Год назад

    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 ?

  • @sjjjaiswal6521
    @sjjjaiswal6521 2 года назад

    Great video

  • @serogs
    @serogs 2 года назад +2

    great video helped me a lot, it would be nice if you made a drawer menu in this project, thanks in advance

  • @lachywardle2559
    @lachywardle2559 Год назад

    Nice introo

  • @buddhadas5828
    @buddhadas5828 2 года назад +2

    Thank You..!

  • @johnymadrita9065
    @johnymadrita9065 Год назад

    Hi. How to write a function that clicks at x = 100, y = 100 on a smartphone in android studio? Without touching the screen.

  • @lover1301
    @lover1301 Год назад

    You can do it easier with the navigation folder, just make the menu is same fragments id 🎉

  • @Mohit-gb9dv
    @Mohit-gb9dv 2 года назад

    when I remove appbar by doing noactionbar in theme ,,the bottom navigation bar color changes what should I do

  • @candrasniper3404
    @candrasniper3404 Год назад

    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?

  • @thethtoozaw9958
    @thethtoozaw9958 2 года назад

    Thanks you sir I needed it so bad

  • @nidaboota4037
    @nidaboota4037 2 года назад

    Thank you so much Sir

  • @khanaftab9041
    @khanaftab9041 Год назад

    I have added custom .xml file for toolbar, when I add FrameLayout it hides the toolbar of my app, wht to do??

  • @antonitier3545
    @antonitier3545 Год назад

    Great video! :D

  • @theredd1703
    @theredd1703 Год назад

    Thanks!

  • @sanchowdiaz5137
    @sanchowdiaz5137 2 года назад

    why when I change the orientation of the cell phone to horizontal it returns me to the "home" fragment?

  • @pedroaguiar6984
    @pedroaguiar6984 Год назад +1

    This tutorial is slightly outdated: you won't be able to compile it unless you change the switch-case to an if-else.

  • @brilliantridho6154
    @brilliantridho6154 Год назад

    How to change the icon color? While tap that icon turn into orange from black

  • @shaheendevelopers415
    @shaheendevelopers415 2 года назад

    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?

  • @mrpip7171
    @mrpip7171 Год назад

    thank you for the tutorial but theres an error "unexpected return value" any idea how to fix it? tq in advance

  • @gendalin6075
    @gendalin6075 2 года назад

    hello.
    how to enable shift animation, when the selected element shifts the rest?

  • @saahibjee7265
    @saahibjee7265 Год назад

    constant expression error while compile
    ???? help out plz

  • @BesteresPT
    @BesteresPT 11 месяцев назад

    8:14 I get "Constant expression required" error :/

  • @AnkitSingh-mx3cc
    @AnkitSingh-mx3cc 2 года назад

    bhai android ka complete syllabus kab leke aoo ge plzz make a video on it

  • @vnslg
    @vnslg Год назад

    thank u brother

  • @williesmite509
    @williesmite509 2 года назад

    hi. why does my navigation bar go missing after i click on each icon?

  • @khanaftab9041
    @khanaftab9041 Год назад

    How can I add Activity in place of first fragment?

  • @borismassesa9553
    @borismassesa9553 2 года назад

    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

  • @lukasfili668
    @lukasfili668 Год назад

    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?

  • @technicalgrowth1335
    @technicalgrowth1335 2 года назад +2

    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

  • @garrysingh4484
    @garrysingh4484 2 года назад

    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 ) ???

  • @ektoplaasm
    @ektoplaasm Год назад

    love you boss

  • @rafaMeneguzzo
    @rafaMeneguzzo Год назад

    Perfect!

  • @boranturan
    @boranturan Год назад

    Thank you liked yo video

  • @princekumarkushwaha
    @princekumarkushwaha 2 года назад

    when i have created binding variable in some other class except MainActivity, the id of the bottomNavigation is not able to search

    • @samuelkioko2312
      @samuelkioko2312 2 года назад

      Same case.. You managed to solve? How?

    • @stefania3582
      @stefania3582 2 года назад +1

      @@samuelkioko2312 You need to change on line 16 ActivityMainBinding with ActivityClassNameBinding. ClassName is the name of the activity where you write the code.

    • @samuelkioko2312
      @samuelkioko2312 2 года назад

      @@stefania3582 thank u

    • @NguyenTuan-pu7ye
      @NguyenTuan-pu7ye 2 года назад

      @@stefania3582 for ex my activity name SecondActivity, so i change it with ActivitySecondActivityBinding like that, isn't true ?

    • @stefania3582
      @stefania3582 2 года назад

      @@NguyenTuan-pu7ye yes

  • @duy7191
    @duy7191 Год назад +1

    and now, the 1000 likes

  • @rishabh1059
    @rishabh1059 Год назад

    can we use constraint layout instead of Framelayout ?

    • @_foxandroid
      @_foxandroid  Год назад

      Anyway you are going to replace it with fragment any particular reason?

  • @shardracknanajunior1597
    @shardracknanajunior1597 Год назад

    Having issues with the viewBinding in the build gradle module. Seems my android studio doesn't recognize that code

    • @trumanyen1544
      @trumanyen1544 Год назад +1

      make sure you press sync in the top right hand corner after changing the gradle code. I had the same problem

    • @jackseabolt6456
      @jackseabolt6456 Год назад

      @@trumanyen1544 thank you

  • @adrianmercktrapa849
    @adrianmercktrapa849 Год назад

    viewBinding not found how to fix?

  • @ericyoung6420
    @ericyoung6420 2 года назад

    My bottom navigation view is all blank. No icon there. Anyone knows how to solve it?

  • @aayushbhatt3559
    @aayushbhatt3559 2 года назад

    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

    • @corinagherasim3340
      @corinagherasim3340 2 года назад +4

      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!

    • @aayushbhatt3559
      @aayushbhatt3559 2 года назад

      @@corinagherasim3340 tysm i tred this they both are same ...n m working on activity

  • @_foxandroid
    @_foxandroid  Год назад +1

    Watch this video with full audio at this link ruclips.net/video/jOFLmKMOcK0/видео.html

    • @kRiShAnN.
      @kRiShAnN. Год назад

      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?

  • @vpraneeth554
    @vpraneeth554 2 года назад +1

    Do you have kotlin version for this

  • @betdmalvom9526
    @betdmalvom9526 Год назад

    Can’t find buildFeature??

  • @SANIYASHAIKH-fm4jt
    @SANIYASHAIKH-fm4jt Год назад

    binding.bottomNavigationView2.setOnItemSelectedListener(item->{
    ^
    symbol: variable bottomNavigationView2
    location: variable binding of type ActivityMainBinding how to overcome this errer

  • @uzairnasir3288
    @uzairnasir3288 2 года назад

    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

  • @Monica-cq2hr
    @Monica-cq2hr Год назад

    For me first icon alone not showing sir... kindly help me sir

  • @gilmarcossantos3951
    @gilmarcossantos3951 2 года назад +2

    Muito obrigado!

  • @Mikebrowski
    @Mikebrowski 2 года назад

    How do you do this if you have another activity??? In between

    • @bernard9163
      @bernard9163 2 года назад

      Do you have solutions after 2 weeks? haha, cause im in trouble now

    • @corinagherasim3340
      @corinagherasim3340 2 года назад

      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!

  • @muzammilansari381
    @muzammilansari381 Год назад

    veiwBinding not found

  • @shubhampradham9797
    @shubhampradham9797 Год назад

    Audio nahi atta dich me

  • @khanaftab9041
    @khanaftab9041 Год назад

    My app is crashing

  • @benedictperalta1049
    @benedictperalta1049 2 года назад +1

    not working, waste of time :

  • @shubhampradham9797
    @shubhampradham9797 Год назад

    Apko video bnana ata ho to hi bnao

  • @lilstinker5475
    @lilstinker5475 Год назад

    13 minutes

  • @gtech7496
    @gtech7496 2 года назад

    Araaam se kr bhai saans to lene de be

  • @vikashparajuli
    @vikashparajuli 2 года назад

    Not a good idea to follow this video in 2022.

  • @shubhampradham9797
    @shubhampradham9797 Год назад

    Pahele edit karna achese

    • @_foxandroid
      @_foxandroid  Год назад

      Click on the pinned comment with full audio

  • @ThắngĐàoDương
    @ThắngĐàoDương Год назад

    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

    • @perlarx
      @perlarx Год назад

      replace switch method by if, else if statements method !

  • @chrisxangel8089
    @chrisxangel8089 2 года назад

    i cant extract when i run the code and this is will show up
    Can not extract resource from com.android.aaptcompiler.ParsedResource@4b038330.

  • @todaysmarket2688
    @todaysmarket2688 2 года назад

    Thanks for information 👍