Hi I am having trouble understanding how to control my listeners in bulk. I managed to get some work from Stack Overflow, but EditText turns me on.
I have 3 editTexts and they all work with pleasure, if I idenpentatly enter the code, but I want all of them to be included in the same method with the switch enclosure.
at the moment, my code for one edittext looks like this (and with two more it's a bit dirty)
intTextValue = (EditText)findViewById(R.id.intervalValue); intTextValue.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub Double.parseDouble(intTextValue.getText().toString()); if (textViewTouchIsHuman == true) { intSeekValue = Double.parseDouble(intTextValue.getText().toString()); calculateWorkings(); } textViewTouchIsHuman = true; } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } });
I tried to use setOnKeyListener, setOnClickListern, addtextchangedlistenr, but I can not get them to work? Hope this question will make the senese. thanks in adv.
source share