代码如下,为什么报错啊??!?!?
import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import android.widget.Button;
import android.widget.EditText;
import android.view.KeyEvent;
//import android.widget.ListView;
import android.widget.Spinner;
public class EX04_08 extends Activity
{
private static final String[] countriesStr = { "A", "B", "C", "D", "E", "F" };
private static final String[] countriesStr1 = { "1","2","3","4","5","6"};
private TextView myTextView1;
private TextView myTextView2;
private TextView myTextView3;
private EditText myEditView1;
private EditText myEditView2;
private EditText myEditView3;
private Spinner mySpinner1;
private Spinner mySpinner2;
private ArrayAdapter adapter1;
private ArrayAdapter adapter2;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myTextView1 = (TextView) findViewById(R.id.mytextview1);
myTextView2 = (TextView) findViewById(R.id.mytextview2);
myTextView3= (TextView) findViewById(R.id.mytextview3);
myEditView1 = (EditText) findViewById(R.id.editextview1);
myEditView2 = (EditText) findViewById(R.id.editextview2);
myEditView3 = (EditText) findViewById(R.id.editextview3);
mySpinner1 = (Spinner) findViewById(R.id.spinner1);
mySpinner2 = (Spinner) findViewById(R.id.spinner2);
myEditView1.setOnKeyListener(new EditText.OnKeyListener() //在这里会报错为什么呢?
{
@Override
public boolean OnKey(View arg0,int arg1, KeyEvent arg2)
{
myEditView1.setText(myEditView1.getText());
}
});