我怎样才能使它使用edittext中的任何内容,就像文本视图一样,如果我输入“hello”按下按钮并将textview设置为“hello”然后当你再次按下按钮时它会删除它?
package com.purelymean.earnings;
import org.w3c.dom.Text;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class Main extends Activity{
/**Called when activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b = (Button) findViewById(R.id.button);
Text et = (Text) findViewById(R.id.editText1);
TextView tx = (TextView) findViewById(R.id.textView1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
}