请当我尝试运行此应用程序时它会停止。
问题在于 OnEditorActionListener,如果我删除应用程序加载并运行正常。
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast;
public class IMEDemo2 extends Activity
{ EditText et;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
et.setOnEditorActionListener(new OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
}
Toast.makeText(getApplicationContext(), "OK", Toast.LENGTH_LONG).show();
return true;
}
});
}
}