title: Android: Colorize word from a String if it contains a specific letter
body: <p>I get the Text from the internet and put the data in a "FeedItem"-class. Now, I want to check the text whether it contains a "@". So, here is my code so far:</p>
  
  <pre><code>        // Check for empty status message
          if (!TextUtils.isEmpty(item.getStatus())) {
              if (item.getStatus().contains("@")) {
                  String[] splited = item.getStatus().toString().split("\\s+");
                  Spannable word = new SpannableString(item.getStatus());
                  for (int i = 0; i &lt; splited.length; i++) {
                      if (splited[i].toString().contains("@")) {
  
                          SpannableString s = SpannableString.valueOf(splited[i].toString());
                          s.setSpan(new ForegroundColorSpan(Color.BLUE), 0, word.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
                      }
                  }
                  statusMsg.setText(word);
  
              } else {
                  statusMsg.setTextColor(R.color.black);
                  statusMsg.setText(item.getStatus());
              }
              statusMsg.setVisibility(View.VISIBLE);
  </code></pre>
  
  <p>I worked with SpannableString and Html.fromHtml but it didn't work for me. The for loop gives me each word from the String. Now if one word contains the "@" i want to colorize only this word.
  Thanks.</p>