0

我有一个隐形EditText:ReplyInput和一个按钮:ShowReply在EditText上模拟触摸事件以显示软键盘

我想在点击ShowReply后显示ReplyInput和软键盘。

任何人有任何想法呢?

感谢阅读:)

+1

[如何打开按钮上的键盘单击在Android?]可能重复(http://stackoverflow.com/questions/8078004/how-to-open-keyboard-on-button-click-in-android) –

回答

2

类似的东西:

InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); 
manager.showSoftInput(ReplyInput, InputMethodManager.SHOW_IMPLICIT); 
0

一种方法是使EditText上可见在点击按钮,使用InputMethodManager,弹出软键盘(Here's how to do it),但有一个更好的方法,那就是显示EditText然后把焦点放在它上面,这样软键盘就会自动启动。