I implement TextWatcher in the Activity:
public class Coordinate extends Activity implements TextWatcher {
/** Called when the activity is first created. */
......
Then
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
........
Part of my problem is that having more than one TextChangedListener causes the app to FC
txtDdLatDeg.addTextChangedListener(this);
txtDMmLatDeg.addTextChangedListener(this);
txtDMSLatDeg.addTextChangedListener(this);
Then
@Override
public void afterTextChanged(Editable s) {
String c = s.toString(); // read Content
// stuff to do later
((EditText)findViewById(R.id.txtDMSLatDeg)).setText(c);
((EditText)findViewById(R.id.txtDdLatDeg)).setText(c);
return;
} // End of TextChanged method
I need to be able to update one EditText and have the other two update on the fly.
I can only seem to make it works when only one EditText has the addChangeListener
.
I also cannot seem to implement a seperate afterTextChanged
method for the individual EditText fields.