Hola este video estará relacionado con crear aplicacion android studio 2019 puedes ver en nuestra web una gran cantidad de aplicaciones para crear aplicacion android studio 2019, recuerda que todo el contenido aquí es de balde solo te pedimos que compartas el articulo por redes sociales si te ha servido mucho contenido sobre crear aplicacion android studio 2019 es de las mejores versiones para tu móvil Android un sistema que es popular en los Smartphones y cada vez es mas popular
In this video you will learn, how to add a bottom navigation to your activity and use it to switch between different fragments. We will fill our BottomNavigationView with 3 menu items and then check which item was selected with the OnNavigationItemSelectedListener interface and a switch statement. We will then create the appropriate fragment and display it in a FrameLayout with help of the getSupportFragmentManager, beginTransaction and replace methods.
Example code + dependency:
____________________
❗ Subscribe to the channel:
https://www.youtube.com/c/codinginflow?sub_confirmation=1
🎓 Find more tutorials and courses on my website:
💻 Hire me for your next project:
📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter
💚 Donate to Coding in Flow with a message:
https://paypal.me/codinginflow
❓ Ask your programming questions in our chat:
https://discord.gg/TSnMvmc
📣 Follow Coding in Flow on other sites:
Facebook: https://www.facebook.com/codinginflow
Instagram: https://www.instagram.com/codinginflow
Twitter: https://twitter.com/codinginflow
Github: https://github.com/codinginflow
⌨️ My gear and tools:
Microphone: https://geni.us/PlNj0
Mouse: https://geni.us/4QHGbA
Keyboard: https://geni.us/uBUTsA
Desk: https://geni.us/oWlUHTu
Preceptor: https://geni.us/Cu0C
Webcam: https://geni.us/cfMB0T
Screen recorder: https://www.techsmith.com/video-editor.html
(above links are affiliate links, which means that I earn a small commission if you buy through them with NO additional costs to you.)
Hola gracias por inspeccionar nuestro sitio aquí encontraras programas juegos y muchas cosas mas
Esta atento a todas las cosas que te puedan suceder con los horoscopos diarios que te brinda esta web lo mejor para enterarse como estara el dia y que te deparan los astros
Este 2019 viene con todo y nuevas peliculas se estrenaran
Serries anime y estrenos como Bird Box se encuentran aquí
La nuevas pelicula de Dragon Ball Super estara habitable para que la veas
Las nuevas peliculas estreno del 2019 tambien las encontraras aqui
Puedes descargar ese bisagra que tanto buscabas utiliza el buscador y encuentra los nuevos estrenos en este 2019
Tutoriales y muchas cosas mas podras encontrar aquí en este sitio
Dale me gusta a nuestra pagina de facebook y siguenos para que te notifiquemos de algun nuevo esparcimiento que este saliendo
Programas con su respectivo crack podras encontrar en el mejor servidor habitable para su descarga sigue las instrucciones al pie de la signo y podras usarlo sin restricciones te deseo un buen año y espero que la informacion que este aquí te sirva hasta luego
DEPENDENCY UPDATE:
If your project is using AndroidX dependencies, add this new dependency instead of the design support library: implementation 'com.google.android.material:material:1.1.0'
________________________________
If you want to keep the selected fragment when rotating the device, make the following little change to the code:
Surround the fragment transaction in the onCreate method with an if/else statement like this (I also changed the code on my website):
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new HomeFragment()).commit();
}
tried the dependencies in the comments too but can't get bottomnavigtion in the xml to work..
I don't know how can I thank you brother!
I have a problem with switching between fragments. My app will go to all other fragments as many times as I press their icons but the moment I press home, it crashes. Help!
Hey, Me and my friend have some problems creating a navigation bar with having a bottom navigation bar. If we create the navigation bar the bottom bar is moving to the center. If someone can help we would appreciate this.
Any idea why when the code runs anything to do with the getSupportFragmentManager it crashes?
Thank you so much!!! By FAR the best tutorial for this I have seen. Worked like a charm, thanks!
great work… exactly what i want
Thank you. You've been very helpful.
Thanks A LOT!
Thanks a lot
Thanks for your kind help.
Amzing
Why I left this tutorial earlier? … you are great
cant add desgin dependancy
if I use <com.google.android.material.bottomnavigation.BottomNavigationView
What's the difference with <android.support.design.widget.BottomNavigationView
Can you help me ? i''m just start learning Android now
In my android studio, there are only 'com.google.android.material.bottomnavigation.BottomNavigationView
' and 'com.google.android.material.bottomappbar.BottomAppBar
', there is no option for design.widgetBottomNavigationView. Can u help?
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.easymarkert, PID: 2438
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.easymarkert/com.example.easymarkert.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.material.bottomnavigation.BottomNavigationView.setOnNavigationItemSelectedListener(com.google.android.material.bottomnavigation.BottomNavigationView$OnNavigationItemSelectedListener)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.material.bottomnavigation.BottomNavigationView.setOnNavigationItemSelectedListener(com.google.android.material.bottomnavigation.BottomNavigationView$OnNavigationItemSelectedListener)' on a null object reference
at com.example.easymarkert.MainActivity.onCreate(MainActivity.kt:19)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Yeah the imports he uses are no longer available, no matter what I do I get errors
I think you are the king in android development
man i 've been stuck on this navigation things, and this tutorial has helped me a lot! Thanks bro!
thanks
Thank you so much for your videos!! Keep going! 🙂
I love it!!
Simple and Clear. Good Job
Thanks alot man for the tutorials!
this is not helped ,there is no video for remove fragment from main layout
Hey, wann verwendet man bei einer Navigation bar Fragments und wann Activitys? Macht das einen Unterschied?
Is there a good way to hide the Bottom Navigation View when keyboard is opened?
very Helpful :)) thank you
Thanks! Its quite easy to follow! <3