我正在尝试获取空格、输入、清除按钮的值,但没有成功我也尝试显示敬酒消息,当我按下回车、空格、清除(其中一个)时,它应该给我一条消息“按下 Enter” . 它应该只发生在虚拟键盘上。我只得到字符值。像“按下:A”
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
et = (EditText)findViewById(R.id.entry);
et.addTextChangedListener(this);
}
@Override
public void afterTextChanged(Editable s)
{
Toast.makeText(this,"Pressed : " +s.toString() ,Toast.LENGTH_LONG).show();
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after)
{
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count)
{
}