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

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -