Android : java syntax of addTextChangedListener(new TextWatcher())

on Tuesday, October 14, 2014


i have a newbie question. Can someone explain what type of java syntax is in code like this. I've googled and but I dont seem to understand how is this an implementation of TextWatcher in anonymus class, (or something like that). All implementations I've seen so far had a keyword implements in a class definiton but this one does not. Any explanations are welcome (I know what this code does and how do I use it, the understanding of syntax is my problem.) If you could rewrite it in a equivalent way would also be great. Thanks



mObjectOfEditText.addTextChangedListener(new TextWatcher() {
public void onTextChanged(parameters) {}

public void beforeTextChanged(parameters) {}

public void afterTextChanged(parameters) {}
});

0 comments:

Post a Comment