In Java on Android when we code using this style
public void OnCreate(Bundle savedInstantState) {
SearchClass = (EditText) findViewById(R.id.SearchField);
SearchClass.addTextChangeListener(new TextWatcer() {
getData task = new getData(this);
}
}
When using this style of coding: How do I pass the context into the textchangelistener? (I call an asynctask with do something with ‘this’ but it requires the context to be passed properly.
In JavaScript you can do something similar to
SearchClass.AddTextChangeListener(new TextWatcher() { ..}).bind(this);
to solve the problem.
In your class declare
Initialize it
You can use it inside your private (inner) classes.