最近有个需求,在过滤的列表上一直弹出输入框,让用户选择下单,也就是说在下单按钮触发后,再次自动弹出输入框,Editext获取焦点。

具体实现代码:

Timer timer = new Timer();
	        timer.schedule(new TimerTask(){
                @Override
                public void run() {
                        InputMethodManager m = (InputMethodManager)
                txtSearchKey.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                        m.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);    
                }   
	        }, 500);

 

 

 

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2022-03-05
  • 2022-01-31
  • 2021-12-24
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案