In my app, i want to save blog post in firebase realtime database and want to upload my post with symbol like this
Is there any way? I didn't found any. My code
mPost.setText(fromHtml(dataSnapshot.child("post").getValue().toString()));
@SuppressWarnings("deprecation")
public static Spanned fromHtml(String html){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}
for <ul><li>Item 1</li><br><li>Item 2</li></ul>
Output:
Item 1
Item 2