Android SpannableString click listener not working

51 Views Asked by At

The texts looks clickable but the onCLickListener is not detecting any clicks. Not sure what the problem is?

    smallPrint = findViewById(R.id.smallPrint);

    SpannableString fullText = new SpannableString(getResources().getString(R.string.welcome_smallPrint));
    ClickableSpan clickableSpan = new ClickableSpan() {
        @Override
        public void onClick(View textView) {
            startActivity(new Intent(WelcomeScreen.this, TermsAndConditions.class));
        }
    };
    fullText.setSpan(clickableSpan, 35, 53, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    smallPrint.setText(fullText); 
0

There are 0 best solutions below