Entering autocomplete text and numbers

we have an AS400 solution on an MDE device. The screen of this application is 24 x 23 characters.

People work with the Application only with numbers for conditions, sizes, damage, ...

Files are always numbers and text. In the new application, they should be able to work with numbers and text.

I defined 8 ImageButtonand 8 AutoCompleteTextViewsfor each state. How can I handle this when Employee enters, for example, 96, that I switch to the next AutoCompleteTExteViews(if it's a one-time mask).

Or how would you decide that?

+4
source share
1 answer

, . 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(); 
        }
    }
});
+1

Source: https://habr.com/ru/post/1684128/


All Articles