Using Fragments with Navigation Drawer Part2

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

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

  • @rogenechristiansviernes3603
    @rogenechristiansviernes3603 6 лет назад

    thanks men.. You helping more student's like me. More tutorial please

  • @shahdjaouni3024
    @shahdjaouni3024 7 лет назад +1

    Thank you very much, You are super designer and android developer ... keep going ...Well-done

    • @AwsRh
      @AwsRh  7 лет назад +1

      thank you so much for the kind words

  • @jppalacios6
    @jppalacios6 7 лет назад +1

    good work will serve me in my project thank you.

  • @vtc011
    @vtc011 6 лет назад +8

    15:32 Where is the nv resource related to Navigation View?

  • @noctiscaelum7760
    @noctiscaelum7760 7 лет назад +1

    Hey my friend! great tutorial!

    • @AwsRh
      @AwsRh  7 лет назад +1

      lol Kim,thank you, glad y like it

    • @noctiscaelum7760
      @noctiscaelum7760 7 лет назад

      Whats the name of the music?

  • @vrstamilcreator
    @vrstamilcreator 6 лет назад

    thank you so much bro. it's very useful for my project

  • @rajupatelbandi
    @rajupatelbandi 7 лет назад +1

    How to handle same fragments form navigation drawer and as well from home fragment dashboard??
    Will you please make a video

  • @tohidulalam4844
    @tohidulalam4844 5 лет назад

    Love you brother

  • @Sport-word
    @Sport-word 7 лет назад +7

    bro thats a nice video
    pls were are the sorce code
    pls make the source code available ok

  • @amanbhardwaj9625
    @amanbhardwaj9625 6 лет назад +1

    Hello Sir, I use Material Collapsing Toolbar that you taught on you another videos but i am not able to use Fragments with Navigation Drawer on that layout .Can you please make video on that .It will helps a lot .

  • @NextGenerationStuff
    @NextGenerationStuff 6 лет назад +2

    The one issue I have with this example is that most people would be developing a Home fragment within such a drawer. How would you implement the Home section; as an activity or a fragments instead?

    • @AwsRh
      @AwsRh  6 лет назад

      use fragments with navigation drawer is more practical

    • @NextGenerationStuff
      @NextGenerationStuff 6 лет назад

      Aws Rh Yes, but how does this work then, since the Home Page is my MainActivity with the navigation drawer nested within? How can Home act as an activity and fragment at the same time?

    • @AwsRh
      @AwsRh  6 лет назад +2

      you can simply set any fragment as the default one, you should atleast have one activity to contain the fragments
      add those lines in your OnCreate function
      FragmentManager fragmentManager = getSupportFragmentManager();
      fragmentManager.beginTransaction().replace(R.id.container,new HomeFragment()).commit();

    • @NextGenerationStuff
      @NextGenerationStuff 6 лет назад

      I don't think you understand what I'm trying to say. So you know when you first launch the app it launches to show XActivity (MainActivity in most cases), how do you insert that activity into the Drawer? Thanks in advance.

  • @viralpatel3080
    @viralpatel3080 6 лет назад +2

    how to back on main activity from after selecting navigation menu? plz help for second part video

  • @meiranaph2783
    @meiranaph2783 6 лет назад +1

    Great tutorial dude, can you make a tutorial how to make submenu in the menus in the nav?

    • @AwsRh
      @AwsRh  6 лет назад

      i will try to make a similar one

    • @meiranaph2783
      @meiranaph2783 6 лет назад

      can you help me put a back button on the action bar in every fragment to return to home activity?

    • @meiranaph2783
      @meiranaph2783 6 лет назад

      how can i make a fragment a default one? like it will show first at start

  • @ahmed.aliqureshi
    @ahmed.aliqureshi 7 лет назад +7

    Your Both Video Drawer and Fragments are Different

  • @joelijakaa4764
    @joelijakaa4764 6 лет назад

    Do you even sleep coz the work your presenting is so perfect and awesome bro.

  • @codenetw
    @codenetw 7 лет назад

    thx! very simply!

  • @dandiaz976
    @dandiaz976 6 лет назад

    Hi, this is a great tutorial!!
    How do i set "some fragment" at start? Example: lauch the app and shows "MyNetwork" Fragment??

  • @LunaVibesRelax
    @LunaVibesRelax 7 лет назад

    Excuse me should i continue on your last navigation drawer that you did on your last tuto? cause i didn't understand

  • @luisscripcaru9219
    @luisscripcaru9219 7 лет назад +1

    Ok so when i browse between fragments and use phone back button to go back to home activity (where my navigation view is) it goest to the first screen instead how can i resolve that?

  • @sIuyu1030
    @sIuyu1030 6 лет назад

    This video helps a lot~
    but how can I use different navigation drawers (navigation view) with different users in the same drawer layout?
    with firebase :/

  • @TWOxGINGEZz
    @TWOxGINGEZz 6 лет назад

    When you change LinearLayout to FrameLayout in activity main xml it changed all my xml using linear to frame is that right ?

  • @rossglover7390
    @rossglover7390 6 лет назад

    Hi I found the tutorial to not be the completely following the previous setup of navigation menu code, and the line setUpDrawerContent(nvDrawer); is different?

  • @thasvarin9
    @thasvarin9 6 лет назад +1

    my fragment is error. what I should do ?

  • @adragon13z
    @adragon13z 6 лет назад +1

    can you tell me how to add overflow icon (the 3 dots) also because i don't know how to use it with the navigation drawer

    • @AwsRh
      @AwsRh  6 лет назад

      simply add setting menu

  • @mahafarooqi1459
    @mahafarooqi1459 7 лет назад +1

    how can i add this navigation drawer to multiple activities? and also if i want to access an another activity on item click how to do that?

    • @AwsRh
      @AwsRh  7 лет назад

      check this usefull link it explain everything
      stackoverflow.com/questions/19451715/same-navigation-drawer-in-different-activities

  • @shivprasadkomul8055
    @shivprasadkomul8055 4 года назад

    thank you

  • @gayathrilakshmi4805
    @gayathrilakshmi4805 6 лет назад +1

    Sir,
    There is no error in my project.... But whenever I click the navigation drawer item that doesn't start a fragment... Pls help me sir🙏🙏🙏

  • @ХАН_Тимур
    @ХАН_Тимур 6 лет назад

    Why is there no smoothness when I open and close this menu? In other programs everything is smooth, but this menu twitches

  • @peerzadamohammadowais1545
    @peerzadamohammadowais1545 6 лет назад +1

    Bro.. how to use swipe refresh on fragment (Webview)?

    • @AwsRh
      @AwsRh  6 лет назад

      sorry i dont know for the moment :D

  • @worstyoutuber6527
    @worstyoutuber6527 6 лет назад

    My main activity content is overlapping with my fragment activity. What to do ?

  • @XxxFoxyf76xxX
    @XxxFoxyf76xxX 7 лет назад +1

    Thanks for the videos, they are very helpful. I'm having a problem though. The app works fine on the emulator, but when I run it off my device, it crashes as soon as I try to slide out the menu. Any ideas why?

    • @AwsRh
      @AwsRh  7 лет назад +1

      sry dude, i can't help you without showing me error logcat, try to post it here

    • @XxxFoxyf76xxX
      @XxxFoxyf76xxX 7 лет назад

      Turns out the images were too high resolution, creating a drawable-xxhdpi and moving the images there solved the problem. Can I ask one more questiuon, is there any way to have the app start on a certain fragment by default?

  • @jatedevelopers2110
    @jatedevelopers2110 6 лет назад +1

    Can we use Constraint layout instead of Fragments? 🤔

    • @AwsRh
      @AwsRh  6 лет назад

      i didnt understand they are two differents things

  • @shubhamsahuSD
    @shubhamsahuSD 6 лет назад

    will this go back if we click on back button ?

  • @nithinpinapaka
    @nithinpinapaka 6 лет назад

    Hi i can add direct class files in the cases used without fragments can you guide me

  • @xx_shelly420_xx4
    @xx_shelly420_xx4 5 лет назад

    Done the exact code in this video, no errors, and nothing happens when I click the different tabs..

  • @shakirzaman6125
    @shakirzaman6125 6 лет назад

    How to change name of user dynamically inside header....because its a seperate file ,so how we can access textView inside another file

    • @AwsRh
      @AwsRh  6 лет назад

      inflate your header layout and change the text view

  • @lavanyalavanya9709
    @lavanyalavanya9709 6 лет назад

    where i can write the toggle on click code in main actvity or home activity

  • @rongshu8282
    @rongshu8282 6 лет назад

    Hello teacher!
    have the video part 1? (Using Fragments with Navigation Drawer Part2) the part 1 i am not found.

  • @kamranqadeer5585
    @kamranqadeer5585 6 лет назад

    if you want to go previous dash board than hide it
    FrameLayout frameLayout=findViewById(R.id.fragment);
    frameLayout.setVisibility(View.GONE);

  • @tohiradbujaborov7100
    @tohiradbujaborov7100 5 лет назад

    I have problem with fragment, the FrameLayout doesn't changing fragments. It just putting fragment under fragment. What to do? Like two FrameLayouts not being friends with each other :)

  • @demiazalvarez9290
    @demiazalvarez9290 7 лет назад +1

    How can I keep the navigation drawer while I am on a new activity?

    • @AwsRh
      @AwsRh  7 лет назад

      check this usefull link it explain everything
      stackoverflow.com/questions/19451715/same-navigation-drawer-in-different-activities

  • @mahanthiprudhvitej2678
    @mahanthiprudhvitej2678 6 лет назад +2

    in navigation view .... where is R.id.nv ? i am nt able to find any nv id in your video ...please do clarify

    • @AwsRh
      @AwsRh  6 лет назад

      nv is the navigation view this is a second part of my previous video

    • @milosdesmo
      @milosdesmo 6 лет назад

      I cant find it!? :(

    • @SyaifulMaulanaAbbidin
      @SyaifulMaulanaAbbidin 6 лет назад +3

      you can goto activity_main.xml
      then...
      inside NavigationView add id parameter below :
      android:id"@+id/nv"
      ---------
      full code:

  • @johnprg1209
    @johnprg1209 3 года назад

    hello there i have an issue... when i press it it change only the title not the other page

  • @pvrranushka1624
    @pvrranushka1624 6 лет назад +1

    ActionBarDrawerToggle is not working with this code.Will that work or need to add extra lines please provide me the solutions..

    • @AwsRh
      @AwsRh  6 лет назад

      did you check the previous part ?

  • @adamantjet9772
    @adamantjet9772 6 лет назад

    I need help** when i press dashboared o anything else in the emulator my app stop working :(

  • @kaisian4940
    @kaisian4940 7 лет назад

    how to highlight the current item that is selected?

  • @makoloherbert7705
    @makoloherbert7705 6 лет назад

    hei.. am trying to find part one of this tut, but ive failed

  • @muthulakshmanan5692
    @muthulakshmanan5692 6 лет назад

    when i add homepage deatils this menu items is not displaying what to do

  • @jtorrejon10
    @jtorrejon10 6 лет назад

    hello good I have a problem in this line, fragmentManager.beginTransaction (). replace (R.id.f1content, myFragment) .commit (); Error: underlined myFragment; Wrong 2nd argument type.Found; 'android.app.Fragment', required: 'android.support.v4.app.Fragment', thanks

  • @marcoantonioaguirregonzale9913
    @marcoantonioaguirregonzale9913 6 лет назад

    Hi, i dont know what to put int the NavigationView nvDrawer = (NavigationView) findViewById(R.id.) Could you help me?

  • @ojogaming
    @ojogaming 6 лет назад

    Thanks to share this. but I have problem. I completed . whyn I click 2nd page apps is off. mens I can't go 2nd page. plz help me

  • @adawiyahabdjalil8156
    @adawiyahabdjalil8156 6 лет назад

    Hey guys. Which coding part should I put to smooth the navigation bar click?

  • @jaysonbeltran3175
    @jaysonbeltran3175 6 лет назад

    I have a problem in Line 62 on MainActivity.java it appeara red underline and its says "Required:android.app.FragmentManager
    Found: android.support.v4.app.FragmentManager" pls help me, ty I have no idea of fixing it

    • @Tashachan
      @Tashachan 6 лет назад

      I have same error pls try with the basic code from android documentation. (I have tested and it works)
      // Insert the fragment by replacing any existing fragment
      FragmentManager fragmentManager = getFragmentManager();
      fragmentManager.beginTransaction()
      .replace(R.id.frag_content, myFragment)
      .commit();

  • @shaheerkhan4098
    @shaheerkhan4098 6 лет назад

    Error in this line will you pls help me..?
    in myFragment the error showing..
    fragmentManager.beginTransaction().replace(R.id.fmdrawer,myFragment) .commit();
    "error: incompatible types: android.app.Fragment cannot be converted to android.support.v4.app.Fragment"

  • @rajkumarr5860
    @rajkumarr5860 7 лет назад +1

    navigation drawer inside how to use recycler view pls help me

    • @AwsRh
      @AwsRh  7 лет назад

      add your recycler view inside the fragment

  • @Sport-word
    @Sport-word 7 лет назад +2

    still waiting for the source code

    • @AwsRh
      @AwsRh  7 лет назад

      sry for the late here is the github proect : github.com/aws1994/NavigatonDrawerv2

  • @nithinpinapaka
    @nithinpinapaka 6 лет назад

    I created one main activity i have written all the code in this tutorial but I didn't created those fragments so now I want add my previous activities to that navigation menu can you help me

    • @AwsRh
      @AwsRh  6 лет назад +1

      hello nithin check my pinned comment in the previous video "create and design a navigation drawe"...

    • @nithinpinapaka
      @nithinpinapaka 6 лет назад

      Aws Rh okay thanks

  • @maximus7043
    @maximus7043 6 лет назад

    ragmentManager.beginTransaction().replace(R.id.piecescontent,myFragment).commit(); Problem with myFragment ( says wrong 2nd type argument ). How would I solve this.

    • @AwsRh
      @AwsRh  6 лет назад

      check your "myFragment" type it should be a Fragment

  • @dayakargoudbandari7193
    @dayakargoudbandari7193 6 лет назад +1

    getSupportFragmentManager (); error what should I do

    • @AwsRh
      @AwsRh  6 лет назад

      show me your main activity code

    • @sumitkalyana6386
      @sumitkalyana6386 6 лет назад

      getSupportFragmentManager (); error what should I do Plz help

  • @soegaraedy
    @soegaraedy 7 лет назад +1

    Why thd back arrow button doesnt work?

    • @AwsRh
      @AwsRh  7 лет назад

      yes, cause i did not complete all the steps of the last tutorial!

    • @emmanuelndaki8257
      @emmanuelndaki8257 7 лет назад +3

      so can you help us to solve that problem please

  • @chris18kzone
    @chris18kzone 6 лет назад

    How to set the network page first when you start the activity

    • @AwsRh
      @AwsRh  6 лет назад +1

      add those two line to your OnCreate method
      FragmentManager fragmentManager = getSupportFragmentManager();
      fragmentManager.beginTransaction().replace(R.id.container,new HomeFragment()).commit();

    • @chris18kzone
      @chris18kzone 6 лет назад

      thanks man, looking more great videos from you cheers!

  • @I_am_pradeep
    @I_am_pradeep 6 лет назад

    HOW TO MAKE NAVIGATION DRAWER MENU ITEMS SCROLL ABLE???

  • @reynunezestrada5871
    @reynunezestrada5871 6 лет назад

    error incompatible types android.app.fragment cannot be converted to android.support.v4.app.fragment

  • @vinkykundnani7046
    @vinkykundnani7046 6 лет назад

    how to use activities instead of fragments?

  • @choglog
    @choglog 7 лет назад +10

    your two tutorials dont fit together :/

    • @AwsRh
      @AwsRh  7 лет назад +2

      sry for that, i will try to make another video explaining everything from scratch

    • @choglog
      @choglog 7 лет назад +1

      Aws Rh I'm sorry if that came across bad, You make amazing videos :-) thanks for taking the time to make them and comment back!

    • @androdev4874
      @androdev4874 7 лет назад +1

      That would be great!

    • @hakanahlstrom8310
      @hakanahlstrom8310 7 лет назад +2

      man I followed the whole tutorial to realize this..
      Error:(69, 68) error: incompatible types: android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentManager

    • @dvendator
      @dvendator 6 лет назад +1

      add following in imports: import android.support.v4.app.FragmentManager

  • @Sparkonme2012
    @Sparkonme2012 6 лет назад

    error: incompatible types:
    android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentManager
    can anyone solve this?

  • @kaviyabs
    @kaviyabs 6 лет назад

    fragmentManager.beginTransaction().replace(R.id.f1content.myFragment).commit(); in this line am getting an error can yu just tell me why..the error it says is (cannot resolve symbol 'myFragment')

    • @AwsRh
      @AwsRh  6 лет назад

      .replace(R.id.f1content , myFragment).commit() ;

  • @annabelle3977
    @annabelle3977 4 года назад

    you did two different videos with two different implemations , anyway doesn't work no error and nothing happens.

  • @mohammednouh5527
    @mohammednouh5527 6 лет назад

    fragmentManager.beginTransaction().replace(R.id.contents, fragment); it is saying: wrong 2nd argument type. found 'android.app.Fragment', required: 'android.support.v4.app.Fragment.'

  • @mic.l4757
    @mic.l4757 6 лет назад

    Replacement for Network.class; ???

  • @sahilpavaskar7264
    @sahilpavaskar7264 6 лет назад

    Items are not responding on click

  • @lavanyalavanya9709
    @lavanyalavanya9709 6 лет назад

    i got apps keeps stopping error

  • @techiejason4347
    @techiejason4347 6 лет назад

    Not Working..
    Could you share me the code.

  • @usmanshaukat6319
    @usmanshaukat6319 6 лет назад

    }
    try {
    myFragment = (Fragment) fragmentClass.newInstance();
    }
    error in fragmentclass

  • @dammy_3107
    @dammy_3107 6 лет назад

    i have an error on (this, dl, "open", "close");can someone help me. i'm a beginner

    • @AwsRh
      @AwsRh  6 лет назад

      please check the first part

  • @zakariawahyunurutomo877
    @zakariawahyunurutomo877 5 лет назад

    No error and not work. Why ?

  • @nileshkanojia708
    @nileshkanojia708 5 лет назад

    Why use R.id.nv

  • @studywithease1804
    @studywithease1804 6 лет назад

    Listener is not working

  • @ODISHATECH
    @ODISHATECH 7 лет назад +1

    I am the First viewer.

    • @AwsRh
      @AwsRh  7 лет назад

      That s Cool ,
      thank you for the support

    • @ODISHATECH
      @ODISHATECH 7 лет назад +1

      Aws Rh bro would you mind to give your mail adress?

    • @AwsRh
      @AwsRh  7 лет назад

      plus.google.com/u/0/102357841130178213703

  • @vishrutgoyani8071
    @vishrutgoyani8071 6 лет назад +1

    Error:(28, 52) error: incompatible types: String cannot be converted to int
    Error:(56, 68) error: incompatible types: android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentManager
    Error:(60, 11) error: closeDrawers(boolean) is not public in DrawerLayout; cannot be accessed from outside package
    I have these errors plas help me....
    1st error highlights 'dl'.....so pls help .