android - How to get a reference to the last backstack popped fragment? -
i add, show , hide fragments. each time add/show fragment, hide previous fragment , add transaction backstack.
when user presses button, fragment popped , i have reference it.
why need reference? hide when user continues next fragment.
so, how reference popped fragment?
edit-25-04-2013:
here's code explain how add new fragment, while hiding previous one. the question how reference last fragment after popped backstack (using button)?
fragmenttransaction fragmenttransaction = getfragmentmanager().begintransaction(); fragmenttransaction.hide(lastfragment); fragmenttransaction.add(newfragment); fragmenttransaction.addtobackstack(null); fragmenttransaction.commit(); lastfragment = newfragment;
i use generated tags each fragment, save tags in stack , persist stack. way hold of every fragment out there - last 1 in specific. see code here.