0

I have two edittexts.

It is supposed to have this behavior.

With addTextChangedListener every number input from edittext1 will be +1 and then the sum will be displayed on edittext2. If I input 2000 on edittext1 then edittext2 should then display 2001.

edittext2 should never be able to be editted by the user using the softinput . I was able to disable the softinput from showing by using

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // API 21
        edittext2.setShowSoftInputOnFocus(false);
    } else { // API 11-20
        edittext2.setTextIsSelectable(true);
    }

However, if the softinput is opened while changing edittext1 and then the user clicks edittext2 the softinput doesnt get hidden so the user can still enter input.

I know that using setEnabled(false) would solve all of my problems however, I want to the app to still be able to focus on edittext2 to access the setError() message;

Thank you in advance.

RFA
  • 771
  • 1
  • 5
  • 14
  • so why don't you use a TextView instead? – forpas Oct 26 '18 at 15:56
  • Just a student here so this may be a silly question but, can you use setError() in TextView? And have the error message pop up when I click on it? – RFA Oct 26 '18 at 16:00
  • Read this https://stackoverflow.com/questions/13508270/android-seterrorerror-not-working-in-textview/15954372#15954372 – forpas Oct 26 '18 at 16:02

0 Answers0