I have a class:

public class dialogs extends Activity implements TextWatcher { ... } 

Trying to remove an item from the listView list by a long press on it. To do this, as far as I understand it is necessary to add the line implements AdapterView.OnItemLongClickListener to the class definition. As a result, it turns out like this:

 public class dialogs extends Activity implements TextWatcher implements AdapterView.OnItemLongClickListener{ ... } 

But almost after that, the whole class is full of errors. What am I doing wrong?

  • By the way, classes in Java are named with a capital letter. - JuriySPb
  • one
    Implemented interfaces are listed separated by commas - pavlofff

1 answer 1

You told the compiler that your class implements the intend but did not give it an implementation. You need to either implement the interface in the class or make the class abstract.

For the first option, just press Alt+Enter on the interface name and select implement methods - the desired method with an empty implementation will appear in your class.