Is there a way to get an event in my Android activity when the focus is cleared from all views in it (ie. getCurrentFocus() will return null)?
We have an Android app that combines a GLSurfaceView with EditText objects positioned on top of it (not as children, that's not possible). At some point, clearFocus() is called on the EditText, so focus is removed from it. The focus is not given to our surface view.
FrameLayout - not focusable
- GLSurfaceView (regular rendering view) - focusable
- RelativeLayout
- EditText - focusable
clearFocus() will try to set focus to the first focusable view, but it doesn't find our GLSurfaceView, I guess because its a sibling not a parent.
So we end up with nothing focussed. I would like to detect this situation, without having to add code to every possible case that causes it.