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 6689559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:32:01+00:00 2026-05-26T05:32:01+00:00

How can I display a image for html in a textview? Here is the

  • 0

How can I display a image for html in a textview?
Here is the resource

<blockquote>小浪观剧团:<p>【郭德纲《今夜有戏-济公传》】@北京德云社 15周年庆@郭德纲 相声专场演出,最新一季《济公传》,天津卫视@今夜有戏 整合全程播出。 http://t.cn/asLuvf 点击进入“德云社15周年系列演出新浪独家视频专题”http://t.cn/aogRf9<br/><a href='http://ww3.sinaimg.cn/large/5e1f33eftw1dm3fva4u3lj.jpg' target='_blank' ><img src='http://ww3.sinaimg.cn/thumbnail/5e1f33eftw1dm3fva4u3lj.jpg'><\/a><\/p><blockquote><p><a href='javascript:Action(\"sinat:qq357068756@163.com\",\"RT:3368361715304896\",\"\")'><img src='http://www.shisoft.net/images/retweet.png' /><\/a><\/p>

I know I should use the Html.fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler)

But I don’t know how to get the ImageGetter, Can anyone help?

  • 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-26T05:32:02+00:00Added an answer on May 26, 2026 at 5:32 am

    This worked for me,

    Implementing a ImageGetter is straight and simple; you pass an ImageGetter object to be use to fetch the images that later will be use to fill the placeholders. In order to fetch the images the ImageGetter object must implement the getDrawable method. The getDrawable method must return the Drawable object that will fill the placeholder; but, if null is returned the generic image placeholder will be used instead (see implementation below).

    For ImageGetter you need to override the method below:

    public Drawable getDrawable (String  source)
    

    To get images from the application resources first in the text file one inserts an html image tag like this:

    <img src="my_image">
    

    Note that “my_image” is just a name of a drawable not a path. Then use this code to diplay the text with images in TextView

      myTextView.setText(Html.fromHtml(myText, new ImageGetter() {                 
        @Override
        public Drawable getDrawable(String source) {
         Drawable drawFromPath;
         int path = myActivity.this.getResources().getIdentifier(source, "drawable", "com.package..."); 
         drawFromPath = (Drawable) myActivity.this.getResources().getDrawable(path);
         drawFromPath.setBounds(0, 0, drawFromPath.getIntrinsicWidth(), drawFromPath.getIntrinsicHeight());
         return drawFromPath;
        }
    }, null));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using JQuery Scrollables to display an image gallery, see http://www.mba-europe.de/lehr_veroff.html In my setup,
Examotion has a player that can display the image for svg files as a
i can't display the image on my aspx view.. i'm using mysql as database
How can I display jpg image which I stored in arraylist in JPanel? Im
how can i display a image on button which is presented on UINavigationController iphone
How can I display the circular swirl image, that is usually seen in asp.net
How can I display a preview (almost like a hint) of an image when
How can i compress and image file(*bmp,*jpeg) in C#, I have to display some
When I click the href, I want to display the image and description from
I want to display the content of an html page and an image to

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.