, getView, ListView, TextWatcher , . , .
public class MySimpleCursorAdapter extends SimpleCursorAdapter {
public MySimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) {
super(context, layout, c, from, to, flags);
}
@Override
public View getView(int pos, View v, ViewGroup parent) {
v = super.getView(pos, v, parent);
final EditText et = (EditText) v.findViewById(R.id.classpercentage);
et.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) { Log.d("TEST", "In afterTextChanged"); }
public void beforeTextChanged(CharSequence s, int start, int count, int after) { Log.d("TEST", "In beforeTextChanged"); }
public void onTextChanged(CharSequence s, int start, int before, int count) { Log.d("TEST", "In onTextChanged"); }
});
return v;
}
}
private void showClasses(Cursor cursor) {
SimpleCursorAdapter adapter = new MySimpleCursorAdapter(this, R.layout.classrow, cursor, FROM, TO);
setListAdapter(adapter);
}