简体   繁体   中英

How can I strip out all HTML from my string

When I save text from an EditText I save it with Html.toHtml(editable);

Now I need to display the text but without the HTML and not in an EditText or TextView

I need to display it in a notification bar notification so I need all the HTML gone.

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
        .setSmallIcon(R.drawable.ic_launcher)
        .setTicker("You have a recieved a message. " +Html.fromHtml(message).toString()) // html still showing
android.text.Html.fromHtml(string).toString()

这工作了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM