Take the 2-minute tour ×    Is there a way of referencing the
parent activity and getting the currently focused EditText
without passing the activity into the view?  share|improve this
question add comment  1 Answer  up vote 46 down vote accepted
following methods may help you  1. Activity host = (Activity)
view.getContext()  2. view.isFocused() share|improve this answer
Awesome, this is what I was looking for. Thanks, –  mAndroid Nov
27 '11 at 1:44 Just don't forget that getContext() may not
always return an Activity object if your View is not called from
an Activity context. Make sure to plan this ahead and provide an
appropriate fallback. –  WordPress Developer Sep 20 '13 at 15:19
add comment  Your Answer