action on long press of edit edittext

Solutions on MaxInterview for action on long press of edit edittext by the best coders in the world

showing results for - "action on long press of edit edittext"
Pietro
14 Aug 2019
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