How to show Java code in a TextView?
Asked
Active
Viewed 134 times
-2

Phantômaxx
- 37,901
- 21
- 84
- 115

Priyansh Mishra
- 21
- 1
- 5
-
2Most likely, that is using a `WebView` and one of the many syntax-highlighting libraries, not `TextView`. – CommonsWare Aug 06 '17 at 12:08
1 Answers
0
you can store your code as HTML and parse HTML using HTML.fromHtml(String) to show styled HTML in your TextView
. for more information, take a look at here

Mohammad Rahchamani
- 5,002
- 1
- 26
- 36
-
when i do this , the code appear like this in the format http://prntscr.com/g5h8mq – Priyansh Mishra Aug 07 '17 at 15:44