Sunday, September 28, 2014

Android : Drawer Navigation, it's fragments buttons doesn't find the right actionlistener



I've some problems with the drawer navigation. I've tried much and googled a lot but didn't find a solution. I'm using a drawer navigation. There you have to fill it's frame layout with fragments. That works fine, so for example: I pick something in the drawer layout and the frame layout loads the fragment (startdisplay in my app) with buttons and textviews. Now I click on one of the fragments buttons, this should call the actionlistener in the fragments java class (startdisplay.java), but instead it's not finding these actionlisteners (android studio also tells me that these are never used). I found out that the app is looking in the drawer navigation class (mainmenuactivity in my app).


My question is if there is a way that my app is looking directly in the fragments java class, because I can't put all my code in one class (mainmenuactivity). Of course this won't be my only fragment that I'd have to put in there.


Thanks in advance


No comments:

Post a Comment