title: EditText onChangeListener function Android
body: <p>I have the following code:</p>
  
  <pre><code>nameOfInf.setOnFocusChangeListener(new OnFocusChangeListener() {
      if (strTollAmount.length() &gt; 0) {
          nameOfInf.setBackgroundColor(getResources().getColor(android.R.color.white));
          nameOfInf.setTextColor(getResources().getColor(android.R.color.black));
      }
  });
  tollAmount.setOnFocusChangeListener(new OnFocusChangeListener() {
      if (strInfName.length() &gt; 0) {
          tollAmount.setBackgroundColor(getResources().getColor(android.R.color.white));
          tollAmount.setTextColor(getResources().getColor(android.R.color.black));
      }
  });
  </code></pre>
  
  <p>The function checks to see if the value on the textbox is anything other than empty or null. So if the user enters something in the text box the background and foreground color should change. But that's not happening. Any idea how to edit it?</p>