How to Implement Bottom Navigation with Activities | Android Studio Tutorial

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

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

  • @faizaali8009
    @faizaali8009 Год назад +4

    Very nice videos It helped me in my project very much....Thankyou very much.
    I'll recommend your videos to my fellows as well..👍

  • @grinplay7127
    @grinplay7127 8 месяцев назад +2

    Hello, whu my icons are jumping if i remove slide animations, can it be fixed?

  • @EdcelJohnLorenzMLero
    @EdcelJohnLorenzMLero Год назад +5

    case R.id.bottom_home: error: Constant expression required. How do I fix this please help😢 13:30

    •  Год назад +1

      Same error

    • @ДанилАнуфриев-э3к
      @ДанилАнуфриев-э3к Год назад +12

      I've met a similar error. Click on switch, then alt+enter and "replace switch with if"

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

      This works. Thank you.

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

      use if-else constuction

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

      ​@@ДанилАнуфриев-э3к❤❤❤❤❤ 😭😭😭❤❤❤❤❤❤ thanku thanku thanku so much 😊🙏🙏🙏🙏🙏🙏❤❤❤❤❤❤❤❤

  • @user-fx5uz6hg5f
    @user-fx5uz6hg5f Год назад +1

    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?

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

      Please, use if else instead of switch case :-)

    • @TheHugoSpy
      @TheHugoSpy 7 месяцев назад

      @@android_knowledge i get Unexpected return value on all true and false now with an if else

  • @novayoutube2937
    @novayoutube2937 Год назад +3

    Awesome very helpful video 👏

  • @KhantSiThuPhyo-c5c
    @KhantSiThuPhyo-c5c Год назад +1

    Ohh is was not following the principal of DRY.How can we refector this ?

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

    Keep going 🥳

  •  Год назад +1

    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

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

      same issue

    •  Год назад +1

      @@samriddhpandey745 put something like this @Override
      protected void onResume() {
      super.onResume();
      BottomNavigationView bottomNavigationView = findViewById(R.id.MENUITEM);
      bottomNavigationView.setSelectedItemId(R.id.MENUITEM);
      }

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

    when I'm in an item, the item becomes appropriately white but its background becomes kind of pink...do u know why?

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

      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.

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

    why do you recommend to use fragment instead of activity in bottom navigation bar?

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

      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

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

      @@android_knowledge activity is repeated created and fragment replace

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

      correct

  • @kevinpermana6214
    @kevinpermana6214 7 месяцев назад

    why android BottomAppBar have extra bottom padding?

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

    bro can u do this for kotlin pls?

  • @zareen_kitchen
    @zareen_kitchen Год назад +2

    Thanks for sharing 😊

  • @HiteshRaj-t7x
    @HiteshRaj-t7x Год назад

    Cannot resolve method 'getItemId' in 'View' how to resolve this

  • @hammadansari1031
    @hammadansari1031 10 месяцев назад

    @Android Knowledge
    "bottom_menu" is empty in design. how can i solve this?

    • @HyperKK
      @HyperKK 5 месяцев назад

      Change background color it seems like its blank but itd actually becoz of white color background

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

    Error, How to resolve this?
    Cannot resolve method 'setOnItemSelectedListener' in 'BottomNavigationView'
    Cannot resolve method 'getItemId()'

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

      The variable might not be defined properly.
      You can check the below link for more details:
      stackoverflow.com/questions/37706672/cannot-resolve-method-finditemint

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

    Keep Going :)

  • @pushtidave2713
    @pushtidave2713 7 месяцев назад

    hello sir i need help when i run a code i get error on switch case. this is the error message "Constant expression required"

  • @thusith-tec307
    @thusith-tec307 Год назад +2

    Thank you ❤️

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

    I have Error at the style tag "Element style must be declared" , at 03:50

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

      Please check the below link:
      stackoverflow.com/questions/20790708/element-must-be-declared-error-for-tag-shape

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

    As an iOS developer I really hope that's not the way it needs to be done on Android!

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

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

  • @DUCK-ox9mu
    @DUCK-ox9mu Год назад

    "bottom_menu" is empty in design. how can i solve this?

    • @okif9847
      @okif9847 4 месяца назад

      Same problem

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

    Thank you

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

    How to show text under home icon , search icon, settings icon

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

      Set labelVisibilityMode as "label" in activity _main.

    • @Sk_earningOfficial-1
      @Sk_earningOfficial-1 Год назад

      @@android_knowledge and how to change the text colour ??

    •  Год назад

      @@Sk_earningOfficial-1 Item text color

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

    tysm man

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

    Source code ?

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

      I have added source code in the description box, please check :-)

  • @SG-fn1gz
    @SG-fn1gz Год назад

    I have error on the switch case id

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

    5:34 item_selector