Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6374313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:28:20+00:00 2026-05-25T01:28:20+00:00

I have a TextView which I place into an AlertDialog like this: final TextView

  • 0

I have a TextView which I place into an AlertDialog like this:

final TextView textView = new TextView(this);
textView.setText(Html.fromHtml(getString(R.string.alert_quickhints_html)));     
alert.setView(textView);

My alert_quickhints_html is:

  <string name="alert_quickhints_html"><![CDATA[<p><b>Time correction</b><br/>Some text</p>                                     
  <p><img src = "file:///android_asset/icon.png"><b>Report summary</b><br/>Bla bla</p>.../>

I have icon.png in my assests folder. When I execute this code I can see a little red square at the place where the icon should appear. Somehow it seems the icon is not rendered correctly. It’s a PNG with transparency. Does anyone have an idea on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:28:20+00:00Added an answer on May 25, 2026 at 1:28 am

    Android TextView supports only limited set of HTML tags and <img> is definitely not one of them. If you really need to show complex html within a dialog, use WebView.

    UPD
    Actually I was wrong, <img> is kinda supported. Use Html.fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler) method (note imageGetter parameter), to supply images for your html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this XML code which generates a button, a textview and another button,
I have a TextView that will hold a styled, multiline string. This text is
I have the following TextView in my XML layout file:- <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/autolink_test
In my app I have a textView which contains real-time messages from my app,
I have to set the style for a TextView which is created programmatically. How
I'd like to change the font in textview which is in dialog: dialog =
I have seen this question , but the question is how to know which
I have a textview which contains chat history obtained from a server.The chat history
I have service, widget and activity....widget and activity both have one textview which should
I have a some ui widgets including textview inside RelativeLayout which is clickable. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.