I use fragments in my application. I have a snippet containing EditText and some Dialogfragment .
When I click on one particular widget, it will move to the next fragment. I need the first snippet in backstack, so I added the addToBackStack method.
The second snippet does not contain an EditText . Now the problem is that when we touch or click on the second fragment, the EditText in the first fragment gets focus and the dialogs go on.
I got the following code
getView().setFocusableInTouchMode(true); getView().requestFocus();
I put this in onResume() . But onResume() will not be called according to some android docs. What should I do? This is a picture of the second action that shows the problem. 
android focus fragment onresume
Anu
source share