Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpannableString not set in textview in oreo in android

Tags:

string

android

I set text view data from SpannableString. It works correct. But when I press back button from another activity text view not shown data in Oreo. It works correctly in other version but not work in high version. What is reason?

Here my code for set data:

tvItinerari=(TextView) view.findViewById(R.id.tv_1);

 String text = "";
    String name = "";
    for (Itinerary item : arrayList) {
        text += item.getItinerary()+"   ";

    }

    SpannableString ss = new SpannableString(text);


    int start = 0, end;
    for (final Itinerary item : arrayList) {
        setSpanOnLink(ss, item.getItinerary(), new MyClickableSpan(item));
    }

    tvItinerari.setText(ss);
    Log.e("ss",""+ss);  

It works in all version not in Oreo.

Data show correctly in low version like lollipop but not work in High version.

like image 391
Darshi Patel Avatar asked Nov 05 '18 11:11

Darshi Patel


1 Answers

Check arrayList size i think its zero when you back your activity.

like image 99
Darshi Avatar answered Oct 16 '22 19:10

Darshi