I'm trying to show very large text (of length 850879) in textview, unfortunately when I assign text to textview, UI hangs for 8-15 seconds! How do we fix this issue? any idea?
Asked
Active
Viewed 1,054 times
2
-
2How big is `very large`? Do you have an example? – donfuxx Mar 26 '14 at 19:21
-
`850879` chars? That is a lot to be displayed on a mobile device screen.. – donfuxx Mar 26 '14 at 19:29
-
so do we have any work around to fix it without blocking UI? – Khawar Mar 26 '14 at 19:32
-
1Yes, cut the text to a reasonable size and load the rest only if the user actually wants to read it – donfuxx Mar 26 '14 at 19:38
2 Answers
2
Use Webview....instead of textview. Textview is not design to load large text.
WebView webView;
String html;
webView.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");

Avinash Verma
- 2,572
- 1
- 18
- 22
1
Can you spilt the text in small chunks and provide it to a list view... That way ui will not be blocked for what's not visible

rock_win
- 755
- 1
- 5
- 14