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 .
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?
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?
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();
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.
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?
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 :/
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?
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?
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?
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 :)
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
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
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();
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"
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
ragmentManager.beginTransaction().replace(R.id.piecescontent,myFragment).commit(); Problem with myFragment ( says wrong 2nd type argument ). How would I solve this.
add those two line to your OnCreate method FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.container,new HomeFragment()).commit();
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
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')
fragmentManager.beginTransaction().replace(R.id.contents, fragment); it is saying: wrong 2nd argument type. found 'android.app.Fragment', required: 'android.support.v4.app.Fragment.'
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 .
thanks men.. You helping more student's like me. More tutorial please
Thank you very much, You are super designer and android developer ... keep going ...Well-done
thank you so much for the kind words
good work will serve me in my project thank you.
15:32 Where is the nv resource related to Navigation View?
Hey my friend! great tutorial!
lol Kim,thank you, glad y like it
Whats the name of the music?
thank you so much bro. it's very useful for my project
How to handle same fragments form navigation drawer and as well from home fragment dashboard??
Will you please make a video
Love you brother
bro thats a nice video
pls were are the sorce code
pls make the source code available ok
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 .
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?
use fragments with navigation drawer is more practical
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?
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();
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.
how to back on main activity from after selecting navigation menu? plz help for second part video
Great tutorial dude, can you make a tutorial how to make submenu in the menus in the nav?
i will try to make a similar one
can you help me put a back button on the action bar in every fragment to return to home activity?
how can i make a fragment a default one? like it will show first at start
Your Both Video Drawer and Fragments are Different
Do you even sleep coz the work your presenting is so perfect and awesome bro.
thx! very simply!
ty
Hi, this is a great tutorial!!
How do i set "some fragment" at start? Example: lauch the app and shows "MyNetwork" Fragment??
Excuse me should i continue on your last navigation drawer that you did on your last tuto? cause i didn't understand
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?
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 :/
When you change LinearLayout to FrameLayout in activity main xml it changed all my xml using linear to frame is that right ?
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?
my fragment is error. what I should do ?
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
simply add setting menu
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?
check this usefull link it explain everything
stackoverflow.com/questions/19451715/same-navigation-drawer-in-different-activities
thank you
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🙏🙏🙏
Why is there no smoothness when I open and close this menu? In other programs everything is smooth, but this menu twitches
Bro.. how to use swipe refresh on fragment (Webview)?
sorry i dont know for the moment :D
My main activity content is overlapping with my fragment activity. What to do ?
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?
sry dude, i can't help you without showing me error logcat, try to post it here
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?
Can we use Constraint layout instead of Fragments? 🤔
i didnt understand they are two differents things
will this go back if we click on back button ?
Hi i can add direct class files in the cases used without fragments can you guide me
Done the exact code in this video, no errors, and nothing happens when I click the different tabs..
How to change name of user dynamically inside header....because its a seperate file ,so how we can access textView inside another file
inflate your header layout and change the text view
where i can write the toggle on click code in main actvity or home activity
Hello teacher!
have the video part 1? (Using Fragments with Navigation Drawer Part2) the part 1 i am not found.
if you want to go previous dash board than hide it
FrameLayout frameLayout=findViewById(R.id.fragment);
frameLayout.setVisibility(View.GONE);
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 :)
How can I keep the navigation drawer while I am on a new activity?
check this usefull link it explain everything
stackoverflow.com/questions/19451715/same-navigation-drawer-in-different-activities
in navigation view .... where is R.id.nv ? i am nt able to find any nv id in your video ...please do clarify
nv is the navigation view this is a second part of my previous video
I cant find it!? :(
you can goto activity_main.xml
then...
inside NavigationView add id parameter below :
android:id"@+id/nv"
---------
full code:
hello there i have an issue... when i press it it change only the title not the other page
ActionBarDrawerToggle is not working with this code.Will that work or need to add extra lines please provide me the solutions..
did you check the previous part ?
I need help** when i press dashboared o anything else in the emulator my app stop working :(
how to highlight the current item that is selected?
hei.. am trying to find part one of this tut, but ive failed
when i add homepage deatils this menu items is not displaying what to do
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
Hi, i dont know what to put int the NavigationView nvDrawer = (NavigationView) findViewById(R.id.) Could you help me?
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
Hey guys. Which coding part should I put to smooth the navigation bar click?
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
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();
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"
navigation drawer inside how to use recycler view pls help me
add your recycler view inside the fragment
still waiting for the source code
sry for the late here is the github proect : github.com/aws1994/NavigatonDrawerv2
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
hello nithin check my pinned comment in the previous video "create and design a navigation drawe"...
Aws Rh okay thanks
ragmentManager.beginTransaction().replace(R.id.piecescontent,myFragment).commit(); Problem with myFragment ( says wrong 2nd type argument ). How would I solve this.
check your "myFragment" type it should be a Fragment
getSupportFragmentManager (); error what should I do
show me your main activity code
getSupportFragmentManager (); error what should I do Plz help
Why thd back arrow button doesnt work?
yes, cause i did not complete all the steps of the last tutorial!
so can you help us to solve that problem please
How to set the network page first when you start the activity
add those two line to your OnCreate method
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.container,new HomeFragment()).commit();
thanks man, looking more great videos from you cheers!
HOW TO MAKE NAVIGATION DRAWER MENU ITEMS SCROLL ABLE???
error incompatible types android.app.fragment cannot be converted to android.support.v4.app.fragment
how to use activities instead of fragments?
your two tutorials dont fit together :/
sry for that, i will try to make another video explaining everything from scratch
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!
That would be great!
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
add following in imports: import android.support.v4.app.FragmentManager
error: incompatible types:
android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentManager
can anyone solve this?
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')
.replace(R.id.f1content , myFragment).commit() ;
you did two different videos with two different implemations , anyway doesn't work no error and nothing happens.
fragmentManager.beginTransaction().replace(R.id.contents, fragment); it is saying: wrong 2nd argument type. found 'android.app.Fragment', required: 'android.support.v4.app.Fragment.'
Replacement for Network.class; ???
Items are not responding on click
i got apps keeps stopping error
Not Working..
Could you share me the code.
}
try {
myFragment = (Fragment) fragmentClass.newInstance();
}
error in fragmentclass
i have an error on (this, dl, "open", "close");can someone help me. i'm a beginner
please check the first part
No error and not work. Why ?
Why use R.id.nv
Listener is not working
I am the First viewer.
That s Cool ,
thank you for the support
Aws Rh bro would you mind to give your mail adress?
plus.google.com/u/0/102357841130178213703
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 .