title: Prefix euro sign in on edit EditText and remove it when doing getText()
body: <p>I am trying to prefix an Euro sign as soon as a user starts typing in an EditText. This first thing is working. But the problem is as soon as I read it out in code it still has the euro sign. And I cant just remove the euro sign everywhere <code>getText()</code> is called. So what I want is to override the <code>getText()</code> inside this class. But the problem is that the <code>onTextChanged()</code> and  the <code>getText()</code> are starting a infinitive loop as soon as the user starts typing where they keep calling each other.</p>
  
  <p>See code below:</p>
  
  <pre><code>public class CustomEditText extends EditText {
  
    ...
  
  
      @Override
      public void onTextChanged(CharSequence s, int start, int before, int count) {
          if(!s.toString().contains("€") &amp;&amp; !s.toString().equals("")
                  || s.toString().indexOf("€") != 0 &amp;&amp; !s.toString().equals("")) {
              String replaced = s.toString().replace("€", "");
  
              String value = "€" + replaced;
  
              this.setText(value);
              this.setSelection(count + 1);
          }
  
  
  
      }
  
      @Override
      public Editable getText() {
          Editable s = super.getText();
          s.replace(0, 1, "€");
  
  
          return s;
      }
  
      public boolean setCustomFont(Context ctx, String asset) {
          Typeface tf;
          try {
              tf = Typeface.createFromAsset(ctx.getAssets(), asset);
          } catch (Exception e) {
              Log.e(AppConfig.LOGGING_TAG, "Could not get typeface: " + e.getMessage());
              return false;
          }
          setTypeface(tf);
          return true;
      }
  }
  </code></pre>
  
  <p>Does anyone know a solution which solves this problem inside the CustomEditText itself?</p>