@Test public void testNonImplementingContext() { final TextView textView = new TextView(application); final LinkSpan linkSpan = new LinkSpan("test_id"); linkSpan.onClick(textView); }
@Override public void onClick(View view) { final Context context = view.getContext(); if (context instanceof OnClickListener) { ((OnClickListener) context).onClick(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { view.cancelPendingInputEvents(); } } else { Log.w(TAG, "Dropping click event. No listener attached."); } }
LinkSpan extends ClickableSpan { @Override public void onClick(View view) { final Context context = view.getContext(); if (context instanceof OnClickListener) { ((OnClickListener) context).onClick(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { view.cancelPendingInputEvents(); } } else { Log.w(TAG, "Dropping click event. No listener attached."); } } }
LinkSpan extends ClickableSpan { @Override public void onClick(View view) { final Context context = view.getContext(); if (context instanceof OnClickListener) { ((OnClickListener) context).onClick(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { view.cancelPendingInputEvents(); } } else { Log.w(TAG, "Dropping click event. No listener attached."); } } LinkSpan(String id); }
LinkSpan extends ClickableSpan { @Override public void onClick(View view) { final Context context = view.getContext(); if (context instanceof OnClickListener) { ((OnClickListener) context).onClick(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { view.cancelPendingInputEvents(); } } else { Log.w(TAG, "Dropping click event. No listener attached."); } } LinkSpan(String id); @Override void onClick(View view); @Override void updateDrawState(TextPaint drawState); String getId(); }
LinkSpan extends ClickableSpan { @Override public void onClick(View view) { final Context context = view.getContext(); if (context instanceof OnClickListener) { ((OnClickListener) context).onClick(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { view.cancelPendingInputEvents(); } } else { Log.w(TAG, "Dropping click event. No listener attached."); } } LinkSpan(String id); @Override void onClick(View view); @Override void updateDrawState(TextPaint drawState); String getId();  }