action on long press of edit edittext

Java
		Button button = (Button)findViewById(R.id.b1);

button.setOnLongClickListener(

                new Button.OnLongClickListener() {


            public boolean onLongClick (View V){
                EditText e1 = (EditText) findViewById(R.id.editText);
                android.widget.TextView tv = (android.widget.TextView) findViewById(R.id.t1);
                tv.setText("long data "+e1.getText());
return true;

            }

        }


        );


		
Source

Also in Java: