android - How to access navigation drawer in all activities? -


i following tutorial http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/

now fragment,and here able see navigation drawer,now fragment intent next activity , want display navigation drawer in activity

public class whatshotfragment extends fragment {  public whatshotfragment(){}   @override public view oncreateview(layoutinflater inflater, viewgroup container,         bundle savedinstancestate) {      view rootview = inflater.inflate(r.layout.fragment_whats_hot, container, false);      txtchs=(button)rootview.findviewbyid(r.id.txtcheking);       txtchs.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view view) {             intent intent=new intent(getactivity(),allproducts.class);             startactivity(intent);         }     });     return rootview; } } 

the issue want access navigation drawer in allproducts activity..so possible?can help?

call code on button click.

fragment frag = new yourfragment();   fragmenttransaction ft = getfragmentmanager().begintransaction();   ft.replace(r.id.fragment_container, frag);    ft.settransition(fragmenttransaction.transit_fragment_fade);   ft.addtobackstack(null);   ft.commit(); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -