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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -