robert_hly

踩坑填坑记录...

导航

Android Activity中获取当前焦点的控件,自动化输入EditText

获取焦点的view对象
  View view=getWindow().getDecorView().findFocus();
如果是EditText
  if(view instanceof EditText)   {    ((EditText) view).setText("当前焦点");   }


以上来自网络

posted on 2016-12-31 12:57  robert_hly  阅读(1425)  评论(0编辑  收藏  举报