mTextView01 = (TextView)findViewById(R.id.myTextView1); mEditText01 = (EditText)findViewById(R.id.myEditText1); mEditText01.setOnKeyListener(new EditText.OnKeyListener() { @Override public boolean onKey(View arg0, int arg1, KeyEvent arg2) { // TODO Auto-generated method stub mTextView01.setText(mEditText01.getText()); /*判定输入的范例是何种,并与系统毗连*/ Linkify.addLinks(mTextView01,Linkify.WEB_URLS|Linkify. EMAIL_ADDRESSES|Linkify.PHONE_NUMBERS); return false; } });
需要引入
别的监听事件是用EditText的 setOnKeyListener