View vFocus=getWindow().getDecorView().findFocus(); if(vFocus instanceof EditText) { ((EditText) vFocus).setText("当前焦点"); }