title: Find a particular regex word and linkify to open an activity in android
body: <p>I am getting the text from API, can be random, but It contains expressions like on FB
  @xyz hi, @abc how u??
  1. I need to create a regex expression starts with @, ends with space.
  2. Linkify it to open the user activity like XYZ or ABC.
  Please help me, I have tried to create a class like,</p>
  
  <pre><code>import android.text.Spannable;
  import android.text.SpannableString;
  import android.text.Spanned;
  import android.text.method.LinkMovementMethod;
  import android.text.method.MovementMethod;
  import android.text.style.ClickableSpan;
  import android.view.View;
  import android.widget.TextView;
  
  public class ClickSpan extends ClickableSpan {
  
      private OnClickListener mListener;
  
      public ClickSpan(OnClickListener listener) {
          mListener = listener;
      }
  
      @Override
      public void onClick(View widget) {
          if (mListener != null) mListener.onClick();
      }
  
      public interface OnClickListener {
          void onClick();
      }
  
  
      /**
       * To clickify a textview
       * @param view
       * @param clickableText
       * @param listener
       */
      public static void clickify(TextView view, final String clickableText, 
              final ClickSpan.OnClickListener listener) {
  
          CharSequence text = view.getText();
          String string = text.toString();
          ClickSpan span = new ClickSpan(listener);
  
          int start = string.indexOf(clickableText);
          int end = start + clickableText.length();
          if (start == -1) return;
  
          if (text instanceof Spannable) {
              ((Spannable)text).setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
          } else {
              SpannableString s = SpannableString.valueOf(text);
              s.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
              view.setText(s);
          }
  
          MovementMethod m = view.getMovementMethod();
          if ((m == null) || !(m instanceof LinkMovementMethod)) {
              view.setMovementMethod(LinkMovementMethod.getInstance());
          }
      }
  
  } 
  </code></pre>
  
  <p>And call like,</p>
  
  <pre><code>clickify(textView, clickText,new ClickSpan.OnClickListener()
       {
          @Override
          public void onClick() {
             startActivity here..
          }
      });
  </code></pre>
  
  <p>I need help as to how I can get this to work on my activity creating a loop of regex.</p>