I have two Edit Text fields in my application,if i enter 50 in first edit Text then in the second edit text i want to give permission to enter values less than 50 when the user enters a value in the second edit text, i want to give alert to the user if it is bigger than first edit text value.
How can i do this,means i need to check and show the alert when he enter the values i don’t want to show the alert when we press any other fields…
For example:in field 1 if user enter 35
in field2 he has enter value less than 35 only…
I have two Edit Text fields in my application,if i enter 50 in first
Share
initialize both edittext’s, lets called them
myEditText1andmyEditText2in myEditText2 set a listener, there should be some kind of listener for when the text changes. Look for something like
setOnTextChangedListener, here is how it would be used (this is pseudocode)this will only allow the user to enter numerical values lower than the value in the first edit text.
But you need to make sure that the
inputType:of both of your editText fields is set to numeric.