mOutEditText.setOnEditorActionListener(mWriteListener);
private TextView.OnEditorActionListener mWriteListener = new TextView.OnEditorActionListener()
{
public boolean onEditorAction(TextView view, int actionId, KeyEvent event)
{
// If the action is a key-up event on the return key, send the message
if(actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP)
{
String message = view.getText().toString();
sendMessage(message);
}
if(D) Log.i(TAG, "END onEditorAction");
return true;
}
};
출처: http://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html
출처: http://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html
public static interface
TextView.OnEditorActionListener
android.widget.TextView.OnEditorActionListener |
Class Overview
Interface definition for a callback to be invoked when an action is performed on the editor.
Summary
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when an action is being performed.
|
Public Methods
public abstract boolean onEditorAction (TextView v, int actionId, KeyEvent event)
Since: API Level 3
Called when an action is being performed.
Parameters
v | The view that was clicked. |
---|---|
actionId | Identifier of the action. This will be either the identifier you supplied, or EditorInfo.IME_NULL if being called due to the enter key being pressed. |
event | If triggered by an enter key, this is the event; otherwise, this is null. |
Returns
- Return true if you have consumed the action, else false.
'Archive' 카테고리의 다른 글
소프트웨어에 버전을 매기는 방법 (0) | 2011.09.25 |
---|---|
Object를 byte array로 쓰고 읽기 (0) | 2011.09.24 |
안드로이드 액티비티의 생명주기 (0) | 2011.09.23 |
하이퍼링크 브라우저 주소창에서 곧바로 만들기 (0) | 2011.09.22 |
비동기 I/O (Asynchronous I/O) (0) | 2011.09.21 |