title: Android: ClickableSpan in clickable TextView
body: <p>I have a textview that can contain clickable links. When one of this links is clicked, I want to start an activity. This works fine, but it should also be possible to click the whole textview and start another activity.      </p>
  
  <p>So that's my current solution:</p>
  
  <pre><code>    TextView tv = (TextView)findViewById(R.id.textview01);      
      Spannable span = Spannable.Factory.getInstance().newSpannable("test link span");   
      span.setSpan(new ClickableSpan() {  
          @Override
          public void onClick(View v) {  
              Log.d("main", "link clicked");
              Toast.makeText(Main.this, "link clicked", Toast.LENGTH_SHORT).show(); 
          } }, 5, 9, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
      tv.setText(span); 
  
      tv.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              Log.d("main", "textview clicked");
              Toast.makeText(Main.this, "textview clicked", Toast.LENGTH_SHORT).show();               
          }
      });
  
      tv.setMovementMethod(LinkMovementMethod.getInstance());
  </code></pre>
  
  <p>The problem is, that when I set an OnClickListener, everytime I click on a link <strong>first</strong> the listener for the whole textview <strong>and then</strong> the one for the ClickableSpan is called.</p>
  
  <p>Is there a way to prevent android from calling the listener for the whole textview, when a link is clicked? Or to decide in the listener for the whole view, if a link was clicked or not?</p>