title: Populate EditText widget text from another EditText widget text
body: <p>I am trying to populate the text of a second EditText widget with the text from the first EditText widget only when the second EditText widget receives focus, the second widget is not empty, and the first widget is not empty. </p>
  
  <p>I have the following OnFocusChangeListener handler code.</p>
  
  <pre><code>        public void onFocusChange(View v, boolean hasFocus) {
  
          EditText stxt = (EditText) findViewById(R.id.numberone);
          EditText etxt = (EditText) findViewById(R.id.numbertwo);
  
  
          if (hasFocus &amp;&amp; stxt.getText().toString().trim() != "" &amp;&amp; etxt.getText ().toString().trim() == "")
          {
              etxt.setText(stxt.getText().toString().trim());
          }
      }
  </code></pre>
  
  <p>When I run it and click into the second widget it does not populate. When I remove the third constraint ('etxt.getText ().toString().trim() == ""')) it works. so getText() on the second EditText widget is returning something even though the second widget has no initial value other then the text that is displayed via the hint attribute. </p>
  
  <p>How can I accomplish this.</p>
  
  <p>Thanks</p>