1 Button button = (Button)findViewById(R.id.b1);
2
3button.setOnLongClickListener(
4
5 new Button.OnLongClickListener() {
6
7
8 public boolean onLongClick (View V){
9 EditText e1 = (EditText) findViewById(R.id.editText);
10 android.widget.TextView tv = (android.widget.TextView) findViewById(R.id.t1);
11 tv.setText("long data "+e1.getText());
12return true;
13
14 }
15
16 }
17
18
19 );
20
21
22