editText setOnFocusChangeListener出错

iru*_*eru 2 java android

试图使用setOnFocusChangeListener

mMessageBox.setOnFocusChangeListener(new OnFocusChangeListener() {

    @Override
    public void onFocusChange(View v, boolean hasFocus) {
        // TODO Auto-generated method stub

    }
});
Run Code Online (Sandbox Code Playgroud)

但是当我在onCreate函数中使用此函数时,eclipse会给出错误

Multiple markers at this line
    - The method setOnFocusChangeListener(View.OnFocusChangeListener) in the type View is not applicable for the arguments (new 
     OnFocusChangeListener(){})
    - OnFocusChangeListener cannot be resolved to a type
Run Code Online (Sandbox Code Playgroud)

是因为我在清单文件中使用的最小sdk?我在清单文件中的sdk选项是

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="17" />
Run Code Online (Sandbox Code Playgroud)

Ola*_*che 5

编译器已经说过了

new View.OnFocusChangeListener() {
...
}
Run Code Online (Sandbox Code Playgroud)

重点在于View.