The android.widget.TextView setOnLongClickListener is a method used to respond to a long click event on a TextView.
Example:
TextView textView = findViewById(R.id.text_view); textView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { // Do something when the TextView is long clicked return true; } });
In this example, when the user does a long click on the TextView, the setOnLongClickListener will trigger and the code inside the onLongClick method will be executed.
This method belongs to the android.widget package library.
Java TextView.setOnLongClickListener - 30 examples found. These are the top rated real world Java examples of android.widget.TextView.setOnLongClickListener extracted from open source projects. You can rate examples to help us improve the quality of examples.