Thursday, 15 September 2011

java - Android - How to end a Fragment -


I have a navigation drawer in my application, and the way my app works, there is only one activity And if you choose something, this current piece starts / changes from the navigation drawer how can I make it so that when something is selected from the navigation drawer and the new piece starts, the old pieces are finished

I can not do

  public vacuum on @Override) {// TODO Auto-Generated Method Stub SuperPhone (); GetActivity () Finish () .; }   

Because the app needs to be killed because there is only one activity

How do I kill the piece?

Edit: My piece transaction

  Home homefraggement = new home (); Transaction.replace (R.id.lhome, HomeFragment); Transaction.addToBackStack (zero); Transaction.commit (); MDrawerList.setItemChecked (position, true); MDrawerLayout.closeDrawer (mDrawerList);   

thanks

Just call: < Pre> getActivity () onBackPressed () .;

No comments:

Post a Comment