I need to programatically set EditText to display text like password and I also need this EditText to be single line.
I know how to make EditText to display text like password:
editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
I also know how to display EditText on single line:
editText.setEllipsize(TruncateAt.END);
editText.setSingleLine();
I don’t know how to combine these two. When I put these lines of code together, the EditText is not working. Even the software keyboard can’t be displayed for it.
Does anyone of you guys know how to solve my problem? Thanks in advance for your answer(s).
I finally did it. For those who have the same problem the correct approach is to combine the two requests but in the different order than I did it before. So you should do:
I hope this will help someone.