2

I am writing an android application that will be displaying codes... specially java codes, or maybe jsp code as well. I was thinking about placing these codes in a TextView. However i dont know how to do this for android. I didnt find any tutorial or documentation on how to display formated text in a TextView. I know I can put html in there, so one direction would be format the code itself in html and then place it in the textview.

Is there a better way to do that?

Many thanks T

Thiago
  • 5,152
  • 11
  • 35
  • 44

1 Answers1

1

TExtView can't do all the formatting. HTML is the best guess.

Search for "Spannable HTML Textview Android" and you will get quite a few examples. Here is one.

Is it possible to have multiple styles inside a TextView?

Community
  • 1
  • 1
Kumar Bibek
  • 9,016
  • 2
  • 39
  • 68