android – AutoCompleteTextView输入文本和数字

我们在MDE设备上有一个AS400解决方案.

此应用程序的屏幕是24 x 23标志.

人们只使用状态,大小,损坏等数字来处理应用程序.

文件始终是数字和文本.
在新的应用程序中,他们应该有可能使用数字和文本.

《android – AutoCompleteTextView输入文本和数字》

《android – AutoCompleteTextView输入文本和数字》

我为每个州定义了8个ImageButton和8个AutoCompleteTextViews.
我如何处理它,当Employee输入例如96时,我切换到下一个AutoCompleteTExteViews(如果它是单匹配).

或者你会如何解决?

最佳答案 根据你的评论,我更新了答案.

您可以添加TextWatcher并验证用户输入:

autoCompleteTextView.addTextChangedListener(new TextWatcher() {

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        // TODO Auto-generated method stub

    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
            int after) {
        // TODO Auto-generated method stub

    }

    @Override
    public void afterTextChanged(Editable s) {
        if (isValid(s)) { // your method to validate user input
           setWholeTextString(); // get whole string from your adapter or items list
           jumpToNextView(); 
        }
    }
});
点赞