诡异问题!!!
SearchView我复写了一个其中的一个方法 public boolean onQueryTextChange(String newText) {
if (newText.equals(mQueryString)) {
return false;
}
mQueryString = newText;
mSearchView.setQuery(newText, false);
if (mListener != null) {
mListener.onAction(Action.CHANGE_SEARCH_QUERY, mQueryString);
}
return false;
}现在的问题就是使用系统输入键盘,每当我切换到数字输入法的时候,输一个数字后,键盘的输入法就自动的变换到英文模式(应该是重置键盘了),但是当我使用搜狗输入法的时候,上述问题就不在重现了。
求有过类似经历的大神帮忙解释下。
SearchView我复写了一个其中的一个方法 public boolean onQueryTextChange(String newText) {
if (newText.equals(mQueryString)) {
return false;
}
mQueryString = newText;
mSearchView.setQuery(newText, false);
if (mListener != null) {
mListener.onAction(Action.CHANGE_SEARCH_QUERY, mQueryString);
}
return false;
}现在的问题就是使用系统输入键盘,每当我切换到数字输入法的时候,输一个数字后,键盘的输入法就自动的变换到英文模式(应该是重置键盘了),但是当我使用搜狗输入法的时候,上述问题就不在重现了。
求有过类似经历的大神帮忙解释下。
解决方案 »
- android开发,程序运行没有问题,但是按Home键在回到本程序就会报错
- android手机无线网络定位的问题
- android 服务器端 http API的开发
- [求助]如何获得googlemap两点之间线路上所有点的经纬度值
- 如何用多线程实现网络读取天气信息
- 求帮忙解决一个技术问题,在线等
- 制作音乐播放器的问题。
- 用oauth.signpost框架做认证时CommonsHttpOAuthProvider方法应该是运行了,但是界面不跳转,部分代码如下。。新手求指导
- android新手布局问题求指导
- android 长时间运行程序会崩溃,偶发的。没有用到百度地图,下面是报错信息,请大神给出提示
- 怎么让启动的Service一直存在,或者说运行
- 最近刚学android,请教为什么要使用Handle及使用方法
mListener.onAction(Action.CHANGE_SEARCH_QUERY, mQueryString);
}
问题应该在这
mSearchView.setQuery(newText, false);现在基本上确定是setQuery把输入法变换了,但是还是不清楚怎么改了
setQuery是源码中的· /**
* Sets a query string in the text field and optionally submits the query as well.
*
* @param query the query string. This replaces any query text already present in the
* text field.
* @param submit whether to submit the query right now or only update the contents of
* text field.
*/
public void setQuery(CharSequence query, boolean submit) {
mQueryTextView.setText(query);
if (query != null) {
mQueryTextView.setSelection(query.length());
mUserQuery = query;
} // If the query is not empty and submit is requested, submit the query
if (submit && !TextUtils.isEmpty(query)) {
onSubmitQuery();
}
}