Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where & how to use onKey,onkeyDown,onKeyPressed event in android?

Tags:

android

hi where to use onKey and onKeyUp/Down event in android.

e.g. i have one textview . when user pressed any key i want to display that character in textview, In this case which event(above) is used.

PLEASE explain with EXAMPLE 

Or give some other example that get the key event and print in edittext or some other.

Thanks in advance...

like image 850
Hiren Dabhi Avatar asked Nov 13 '10 10:11

Hiren Dabhi


People also ask

How do we use where?

Where is most commonly used as an adverb to define a location or position. It can also be used informally as a conjunction in place of the words "that" or "whereas." As such, "where" is commonly used to ask questions like "Where are my socks?" or make positional statements like, "Home is where the heart is."

What is the difference between where and were?

The word 'where' is used to ask questions about the location/position/place. The word 'were' is used as a plural past tense of the 'be' form of verb. It is used as an Adverb. It is used as a Verb.

Is where a place?

a place; that place in which something is located or occurs: the wheres and hows of job hunting.

What is where examples?

Where is defined as asking for a location. An example of where is asking for the place that you left your car keys; Where did I leave my keys? An example of where is asking someone for the place they are in relation to you; Where are you?


1 Answers

If you are looking this in EditText, its better to use these

editText.addTextChangedListener(new TextWatcher() {
                public void afterTextChanged(Editable s) { 
                    Log.v("TAG", "afterTextChanged");
                }

                public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
                    Log.v("TAG", "beforeTextChanged");
                }

                public void onTextChanged(CharSequence s, int start, int before, int count) {
                    Log.v("TAG", "onTextChanged");
                }
            });
like image 185
Labeeb Panampullan Avatar answered Sep 20 '22 08:09

Labeeb Panampullan