简体   繁体   English

android键盘弹出的问题

[英]Issue with android keypad popping up

I am developing an android application using fragments. 我正在使用片段开发一个android应用程序。 I have a fragment that contains a list that holds some values. 我有一个片段,其中包含一个包含一些值的列表。 when I click on an item in the list view, it get redirected to another fragment. 当我在列表视图中单击某个项目时,该项目将重定向到另一个片段。 I have an Edit Text in that fragment. 我在该片段中有一个“编辑文本”。 When I press on that edit text keypad pops up. 当我按下该按钮时,将弹出编辑键盘。

Now my issue is that when I go backs to the previous fragment with out minimizing the keypad, the keyboards stats in the previous fragment also. 现在的问题是,当我在不最小化键盘的情况下返回上一个片段时,上一个片段中的键盘统计信息也是如此。

How can I remove the keypad when I moves back to the first screen? 当我回到第一个屏幕时,如何移除键盘?

You force fully hide Key Board in Fragment like 您强制完全隐藏Fragment键盘,例如

   InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);                     
   imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM