title: How to get text from material design TextInputLayout correctly?
body: <p>I want to get a text from the material design's TextInputLayout using a custom end Icon.</p>
  <p>I tried to do that:</p>
  <pre class="lang-java prettyprint-override"><code>TextInputLayout textInputCustomEndIcon = findViewById(R.id.editText);
  final TextInputEditText editText = new TextInputEditText(textInputCustomEndIcon.getContext());
      
  textInputCustomEndIcon.setEndIconOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
          if (editText.getText() != null) {
              String text = editText.getText().toString();
      
              Log.i(&quot;MainActivity&quot;, &quot;setEndIconOnClickListener:&quot;+ text);
          }
      }
  });
  </code></pre>
  <p>But I get an empty text, not null but empty!!</p>