【问题标题】:Android soft Keyboard not open on Edit Text Click EventAndroid软键盘未在编辑文本单击事件上打开
【发布时间】:2011-08-20 13:43:25
【问题描述】:

我正在开发基于选项卡的应用程序,其中第一个活动包含一个编辑文本和一个按钮..在按钮的单击事件上,我启动线程并根据编辑文本的搜索条件解析数据。解析成功后,我替换了活动组的内容查看下一个活动... 现在的问题是,当我从第二个活动回到第一个活动时,当我点击编辑文本时,它没有打开他的安卓软键盘..

谁能帮我看看发生了什么事..

我还尝试以编程方式打开 android 软键盘..bt 它不工作..

这是我以编程方式打开键盘的代码..

  InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                // only will trigger it if no physical keyboard is open
                mgr.showSoftInput(etSearch, InputMethodManager.SHOW_IMPLICIT);

【问题讨论】:

    标签: android android-layout android-emulator android-widget


    【解决方案1】:

    我认为这会有所帮助,

    InputMethodManager m = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
      if(m != null){
          m.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
       } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-08
      • 1970-01-01
      • 2016-07-23
      相关资源
      最近更新 更多