Need a check for the type of focusedView, eg. if (focusedView instanceof EditText) {...}