A problem occurs:
An activity with only one recording button on it.
A popupwindow, click the recording button, and issue a command to bring up the popupwindow.
Popwindow contains an edittext. Click the text box and a soft keyboard will pop up for handwriting input. Click the speaker to switch to the voice input. It cannot be switched from handwritten input to voice input.
Close the popupwindow. Otherwise, the content entered earlier will disappear.
There is a conflict:
A. to pop up the soft keyboard when you click edittext, you must set popupwinodw. setfocusable (true );
B. Set popupwindow. setfocusable (false) to prevent the popupwinodw from disappearing when you click the speaker button outside the popupwindow)
These two fires are not acceptable.
Later, I found a method:
Step 1: popupwindow. setfocusable (false );
Step 2: manually set the ontouch listener for edittext. The soft keyboard is displayed:
Inputmethodmanager M = (inputmethodmanager) Context. getsystemservice (context. input_method_service );
M. togglesoftinput (inputmethodmanager. show_forced, inputmethodmanager. hide_implicit_only );
However, it was tragic to find that the pop-up soft keyboard appeared at the bottom layer of popupwinow and was hidden by popupwindow.
Do you understand what I mean? If you do, hope to make a move !!!
In a word, I want to call up the system keyboard in the case of popupwindow. setfocusable (false) and implement the input
Recently: I solved it in one way. Check whether the keyboard is displayed by detecting the layout height. : Http://download.csdn.net/detail/nnmmbb/5133743