xuxiuxi
2017-03-29 55559f11a0832e2e2135cc652a1663ebb7a5fc37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cn.com.basic.face.widget;
 
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.EditText;
 
/**
 * Created by xiuxi on 2017/3/29.
 */
 
public class SearchEditText extends EditText {
    public SearchEditText(Context context) {
        super(context);
    }
 
    public SearchEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
 
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if (keyCode==KeyEvent.KEYCODE_ENTER)
        {
            // Just ignore the [Enter] key
            return true;
        }
        // Handle all other keys in the default way
        return super.onKeyDown(keyCode, event);
    }
 
}