-1

i want to enter a value to a text field and once i enter i want it to view something on a text view automatically.. how to do that in android.?? this is what i tried.

txt.setKeyListener(new KeyListener() {

        @Override
        public boolean onKeyUp(View v, Editable e, int i, KeyEvent k) {
            // TODO Auto-generated method stub
            if(i==40)
            {
                TextView tv=(TextView)findViewById(R.id.textView1);
                tv.setText("Done");
            }
            return false;
        }
Naresh
  • 3,174
  • 1
  • 17
  • 22

1 Answers1

0

Take your input value in an EditText. Compare your EditText's value and accordingly change your TextView. I don't see any use of onKeyUp method.

Or if you really want to use onKeyUp method, I guess this link might help you!

Community
  • 1
  • 1
Naddy
  • 2,664
  • 6
  • 25
  • 38