诡异问题!!!
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;
    }现在的问题就是使用系统输入键盘,每当我切换到数字输入法的时候,输一个数字后,键盘的输入法就自动的变换到英文模式(应该是重置键盘了),但是当我使用搜狗输入法的时候,上述问题就不在重现了。
求有过类似经历的大神帮忙解释下。

解决方案 »

  1.   

      if (mListener != null) {
                mListener.onAction(Action.CHANGE_SEARCH_QUERY, mQueryString);
            }
    问题应该在这
      

  2.   

      mQueryString = newText;
            mSearchView.setQuery(newText, false);现在基本上确定是setQuery把输入法变换了,但是还是不清楚怎么改了
      

  3.   

    mSearchView.setQuery(newText, false);
    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();
            }
        }