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

  • SEARCH
  • Home
  • 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 8135897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:34:14+00:00 2026-06-06T10:34:14+00:00

I have the following text in a string in the resources file: <a href=mailto:mymail@mail.com>&lt;img

  • 0

I have the following text in a string in the resources file:

    <a href="mailto:mymail@mail.com">&lt;img src="mail_big" /&gt;</a>

It shows the image fine (I implemented ImageGetter) but it is not clickable. I have tried adding the Linkify thingy but I don’t think it’s meant for this case, and so it doesn’t work. The setMovementMethod doesn’t work either.

I have tried different combinations of the above:

    <a href="mailto:mymail@mail.com">&lt;img src="mail_big" /&gt;hello</a>

Here, even the “hello” part is not clickable (neither blue nor underlined).

    <a href="mailto:mymail@mail.com"><img src="mail_big" /></a>

This doesn’t even show the image.

    &lt;a href="mailto:mymail@mail.com"&gt;&lt;img src="mail_big" /&gt;&lt;/a&gt;

If I just write the email, without the <a> tag it works perfectly, but I would like to use the image of an envelope that the user can click on. It’s not possible to use an imagebutton because this text is in the middle of a string and so I can’t split it.

Any ideas?

Thanks!

  • 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-06-06T10:34:20+00:00Added an answer on June 6, 2026 at 10:34 am

    I’ll answer my own question.

    I found a solution or rather found out how to do it correctly.

    All I had to do was adding the setMovementMethod call before the call to setText in the TextView and ALSO, and COMPLETELY NECESSARY, remove the attribute “android:autoLink=”all” from the layout. Apparently, parsing mails and urls in a string is mutually exclusive to interpreting the <a> link tags in a string. So one or the other but not both.

    Finally my layout is just a TextView with nothing special, just width and height. The activity looks like this:

        TextView tv = (TextView)findViewById(R.id.about_text);
        tv.setMovementMethod(LinkMovementMethod.getInstance());
        tv.setText(Html.fromHtml(getString(R.string.about_content), new ImageGetter(), null));
    

    And the string is like this:

        <string name="about_content"><a href="mailto:nomail@mail.com"><img src="mail" /></a></string>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Android project's strings.xml file i have following html text <?xml version=1.0 encoding=utf-8?> <resources>
I have the following table and would like to replace the string text of
Supposed I have the following string: string str = <tag>text</tag>; And I would like
I have the following text in xml file: <Config Builder=LP Wizard> <Libraries> <Library Name=XCAMSource/>
I have a string that contains the following text String my_string = hello world.
All, I have the following in my string resource xml file. <?xml version=1.0 encoding=utf-8?>
I have the following table: Tweet(id: integer, from_user: string, tweet_text: string, tweet_id: integer, course_id:
In my Rails project I have the following code: auto_link( h( wrap_long_string(post.text,50) )).gsub(/\n/,<br />)
I have a string in following format TestString 1 <^> TestString 2 <^> Test
I have the following text, I need to extract the exception name and the

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.