In general, the situation is this. There is Activation A, on which there are fragments A, B and C. In the application there is the possibility to login and log out. If the user is at fragment B at the moment he thought of logging out, then when he logged in again, it will be on the same fragment B. fragment, which he was at the time razloginivaniya?
- focus change? - Gorets
- well, something like this; it is necessary that when you log in, you immediately get to the fragment A of the starting activation - ricky
|
1 answer
After successful authorization try
frag1.setFocusableInTouchMode(true); frag1.requestFocus();
- for some reason, these methods are not called by me - ricky
- call them not on fragments, but on the elements that are on them - Gorets
- Alas, it did not help; can somehow it be cleaned (or some other one with a stack) a stack of fragments after successful authorization? - ricky pm
- getActivity (). getFragmentManager (). beginTransaction (). remove (this) .commit (); - Gorets
- so give him the name Fragment.this - Gorets
|