I am unable to figure out how to set text dynamically of an EditText. A fellow user at stackoverflow suggested me to use onTextChanged() but I don't how that either.So I read on it for an hour and when tried to implement it,Errors Errors Errors!
So,I am asking this question again.
I have two EditTexts et1 and et2. Both are of type NumberDecimal.et2 is unfocusable and unclickable.The user can only input value in et1.What I want is that as soon as user enters a number in et1,that number should pe displayed in et2.So,if the user has to enter 10,he will first enter 1 and that 1 should also be displayed in et2.Now to complete the number,he will enter 0 and then the number 10 should be displayed in et2.So,et2 should be updated character by character depending upon the entry made in et1.
This is how I read from et1 :
et1=(EditText) findViewById(R.id.et1);
et2=(EditText) findViewById(R.id.et2);
String read=et1.getText().toString();
if(read.length()!=0)
{
float a=Float.parseFloat(read);
}
Now if I use setText() on et2,that wont be dynamic and furthermore I will have to make use of an button to show the text in et2 and it will show whole String which was entered in et1 until the button was clicked.
Using Listener on et1 is an good idea but I don't know its implementation with onTextChanged since I am a newbie.
Please help.
Thanking you in anticipation.