title: Android validation using TextWatcher
body: <p>Despite the question name this really relates more to basic OOP.</p>
  
  <p>Using TextWatcher for form input validation seems (after some research on the matter) to be the most efficient means of validation available on Android for my purposes. I've run into a fairly elementary problem however.</p>
  
  <pre><code>public class MatchConfig extends Activity implements TextWatcher {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_match_config);
          // Show the Up button in the action bar.
          setupActionBar();
  
          final EditText teamA = (EditText) findViewById(R.id.teamA_editText); //Team A input
          teamA.addTextChangedListener(this);   //Team A validation
          final EditText teamB = (EditText) findViewById(R.id.teamB_editText);  //Team B input
          teamB.addTextChangedListener(this);   //Team B validation
          final EditText halves = (EditText) findViewById(R.id.halves_editText);  //halves input
          halves.addTextChangedListener(this);   //halves validation
              Button start = (Button) findViewById(R.id.start_button);
  
  start.setOnClickListener(new OnClickListener() {
  
      // SEND OFF TO DATABASE HANDLING
  )}
  
  //Other Stuff
  @Override
      public void afterTextChanged(Editable arg0) {
          // TODO Auto-generated method stub
           //Guard against SQL injection, etc.
          Toast.makeText(this, "after text test", Toast.LENGTH_SHORT).show();
  
      }
  
  
      @Override
      public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
          // TODO Auto-generated method stub
          Toast.makeText(this, "before text test", Toast.LENGTH_SHORT).show();
  
      }
  
      @Override
      public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
          // TODO Auto-generated method stub
          Toast.makeText(this, "on text test", Toast.LENGTH_SHORT).show();
  
      }
  </code></pre>
  
  <p>While this code works, I can't see how to implement different afterTextChanged methods for the separate form elements. The validation will naturally be different for various types of input. While I can overload (as opposed to override) a method like afterTextChanged, I have no means to directly call it through these means (and therefore cannot specify the arguments in order to specifically use the overloaded method).</p>
  
  <p>One small aside: is there any way to cut down on the processing that this implementation will likely demand on the android device? I am worried that such calls for each character of user input will eat up CPU. </p>