按钮可显示虚拟键盘? [英] Button to show virtual keyboard?

查看:128
本文介绍了按钮可显示虚拟键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ListView并且可以使用硬件键盘过滤出的项目。不过我应该做的手机,没有硬件键盘,只有一个虚拟的?有没有一种方法来添加一个按钮,当pressed,虚拟键盘显示出来?

I have a ListView and it is possible to use the hardware keyboard to filter out items. However what should I do for phones that don't have a hardware keyboard and only a virtual one? Is there a way to add a button that when pressed, the virtual keyboard shows up?

推荐答案

我可以切换屏幕上的键盘使用下面的code。我希望这是有用的人。

I was able to toggle the on-screen keyboard using the code below. I hope this is useful to someone.

InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMgr.toggleSoftInput(0, 0);

这篇关于按钮可显示虚拟键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆