Activity中弹软键盘

来源:互联网 发布:多线程实例 java 编辑:程序博客网 时间:2024/06/16 23:32
name_ed.setFocusable(true);name_ed.setFocusableInTouchMode(true);Timer timer = new Timer();timer.schedule(new TimerTask() { //让软键盘延时弹出,以更好的加载Activity    public void run() {        InputMethodManager inputManager =                (InputMethodManager) name_ed.getContext().                        getSystemService(Context.INPUT_METHOD_SERVICE);        inputManager.showSoftInput(name_ed, 0);    }}, 500);
0 0
原创粉丝点击