title: Android EditText change colour of a single word while typing (dynamically)
body: <blockquote>
    <p>I have an edit text while typing inside edit text if the word starts with # that particular words color should change , </p>
  </blockquote>
  
  <p>i have implemented textwatcher and found that if text starts with # but do not know how to update the color dynamically ,</p>
  
  <p>Have tried <code>SpannableStringBuilder ssb = new SpannableStringBuilder(yourText)</code> But its static , could anyone help me for dynamic implementation </p>
  
  <p>Here is my code </p>
  
  <pre><code>myEditTxt.addTextChangedListener(new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence text, int start, int count, int after) {
  
          }
  
          @Override
          public void onTextChanged(CharSequence text, int start, int before, int count) {
  
             if (text.charAt(start) == '#') {
                 //here i needs to update the typing text color
              }
          }
  
          @Override
          public void afterTextChanged(Editable s) {
  
          }
      });
  </code></pre>