0

My app uses javamail to get the emails and then I use this Html android class to go through the message body and apply the html tags. But this class ignores CSS code, so if I look at an email which contains such code, it looks like this:

enter image description here

Basically 95% CSS code and 5% content at the bottom of it (not on picture). What are my options to solve this? I didn't really find anything useful so far. (I'm a beginner.)

Community
  • 1
  • 1
logi0517
  • 813
  • 1
  • 13
  • 32

1 Answers1

0

The only thing native to Android that understands arbitrary HTML, like CSS, is WebView. For displaying received emails, use a WebView.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • More or less it actually worked :) Now I have a big problem with it though, for one of the app's function I need the text from the webview. Previously it was easy to get from the textview, but after I looked around I didn't really find a good option so far for webview, if I dont load the data from an actual website. – logi0517 Nov 03 '15 at 18:34
  • @ZoltánUmlauf: [This SO question](http://stackoverflow.com/questions/8200945/how-to-get-html-content-from-a-webview) and many others appear in [a Google search for `android get html from webview site:stackoverflow.com`](https://www.google.com/search?q=android+get+html+from+webview+site%3Astackoverflow.com). – CommonsWare Nov 03 '15 at 18:40