The server returns html markup, I skip it through TextUtils.htmlEncode

The question is how to format the text further?

Either Encoder is superfluous and should you immediately send this text to webView?

enter image description here

    1 answer 1

    Encoder extra. In general, if you want to display only a piece of markup, and not a full html page, then you can use TextView :

     myTextView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>")); 
    • It helped, thank you - Heaven
    • one
      I would like to note that this method starting from API level 24 deprecated and, depending on the version, you need to use this method or the new one in a good way. - post_zeew
    • @post_zeew agree, it is necessary. But the documentation is silent about what kind of flags such should be used. developer.android.com/reference/android/text/… , int) - lllyct
    • one
      @lllyct; On the page to which you linked, the flag values ​​are written. - post_zeew
    • @post_zeew you're right, I'm inconsiderate. Not ready to edit the answer, because not sure which flag to use. - lllyct