android - Fragment Back button -


I know how to add a piece to the backstack, but how do I know when the user presses the back button, The piece I left and where did I go? I need to take a certain action, depending on which I should know which unit I am going through. Especially I should know which team I have left, if it is a fixed piece, then I can remove a button.

Override onBackpressed in activity :

  @Override backdone at public null () {fragment manager FM = matching supportfragmentation manager (); Piece f = fm.findFragmentById (R.id.content_frame); // Get the segment that is currently in the placeholder object tag - f.getTag (); // tag handle with the help of // call super method super.onBackpressed (); }    

Comments

Popular posts from this blog

sql - Return Function using Cursor -

sql server - How to use pivot in this table -

javascript - Is there any way to add a new parameter to a function programmatically? -