Processing large Spanned objects with TextView (setText)
Well, to give you a bit of history on this project - I'm parsing a string that's about 100k in a child thread, and returning the Spanned object from Html.fromHtml().
The issue is when it returns to the main thread - when trying to setText using the Spanned that was just created in another thread, it takes quite a long time processing it from a Spanned object into a displayable format (setText).
I would normally process this in the child thread, but unfortunately, since this is related to the UI, I can't - has to be on the main thread. So, my question is whether there is a way to process the Spanned into something easily interpreted by the setText, so that it doesn't spend a lot of time on the main thread processing it after the child thread has finished.
My biggest issue is that it locks the main thread down doing this.
I found a work around for my problem.
Instead of sending the whole Spanned object and getting it processed onto the TextView all at once, I'm sending smaller pieces, and just appending them to the TextView.
This way my ProgressDialog doesn't lock up completely - it's jerky, but it's better than not moving at all.