简体   繁体   English

在ListView的搜索输入中更改默认键盘语言

[英]Changing the default keyboard language in the search input of a ListView

I've added a simple input search function to a listview: 我向列表视图添加了一个简单的输入搜索功能:

inputSearch = (EditText) findViewById(R.id.inputSearch);
    inputSearch.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
            // When user changed the Text
            MainActivity.this.mAdapter.getFilter().filter(cs);
        }

        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                                      int arg3) {
        }

        @Override
        public void afterTextChanged(Editable arg0) {
        }
    });

I use other language (not english) in the names of listview items. 我在列表视图项的名称中使用其他语言(不是英语)。 But when I try to search some name, there is only english keybord presented. 但是,当我尝试搜索某个名称时,只显示英文键盘。 It does not have change language function. 它没有更改语言功能。 Even set default keybord (with my language) in android settings does not help. 即使在Android设置中设置默认键盘(使用我的语言)也无济于事。 How can I set keyboard with my language as a default in input search? 如何在输入搜索中将键盘设置为默认语言?

AFAIK, Only system apps can change the keyboard language not the ones which are installed from external sources. AFAIK,只有系统应用程序可以更改键盘语言,而不能更改从外部来源安装的键盘语言。

If you want to change the keyboard layout for your app, you need to write your own customised keyboard layout. 如果要更改应用程序的键盘布局,则需要编写自己的自定义键盘布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM