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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:21:23+00:00 2026-06-11T23:21:23+00:00

I have a String: myFullString which looks like: <html> <body style=background-color: transparent; margin-top:75px; padding:0px;>

  • 0

I have a String: myFullString which looks like:

<html>
<body style="background-color: transparent; margin-top:75px; padding:0px;"> 
<style type="text/css"> 
p {margin-left:40px; margin-right:40px; margin-top:40px; margin-bottom:40px; } 
</style> <p> 
<font face="helvetica" size=8 color=white> 
<b>  Heading 
</b></font> 
<font face="helvetica" size=6> <br/> <br/>  
<br/> Address Line 1 
<br/> Address Line 2 <br/> 
<br/> Tel: PhoneNumber 
<br/> Fax: Fax No <br/> 
<br/> <br/><br/>
</font></p> 
</body></html>

I want the phone numbers and/or link if any to appear as clickable/hi lighted. So I wrote the following code:

        Spannable sp = new SpannableString(myFullString.toString());
        Linkify.addLinks(sp, Linkify.ALL);
        final String html = Html.toHtml(sp) ;
        mWebView.setClickable(true);
        mWebView.loadData(html, "text/html", "utf-8");

I get the following result:
hyperlink exists but it shows the whole file

In this webview, the texts are hyperlinked but we are able to see the tags.

I also tried using the following code:

Spannable sp = new SpannableString(myFullString.toString());
Linkify.addLinks(sp, Linkify.ALL);
mWebView.loadDataWithBaseURL(null, sp.toString(),"text/html", "utf-8", "about:blank");

But it’s giving the following output:

loadDataWithBaseURL

It shows the correct text font, but does not link the texts.

How do I modify my code such that the links are shown and it won’t show the tags?
The webview contents are created dynamically.

  • 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-11T23:21:25+00:00Added an answer on June 11, 2026 at 11:21 pm

    Since I was not able to find an easier way…

    I did some thing like this for every line which was to be shown in the webpage:

                String str=mWebFileArray [i].toString();
                if(str.contains("<!- ")){
                    str.replace("<!- ", "<!-- ").replace(" ->", " -->");
                }else{
                    Spannable sp = new SpannableString(str);
                    Linkify.addLinks(sp, Linkify.ALL);
                    str = Html.toHtml(sp) ;
                }
                myArray.add(str);
    

    now, it links the valid text….

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

Sidebar

Related Questions

I have string variable which represents the full path of some file, like: x
i have string col= AB21 which is an excel cell location. I would like
I have string like Rupeshposts-this-question I need a regular expression which can check whether
I have string that look like Array that fetched from other webservice like this
I have string like this : <input name=my_name id=my_id value=my_value class=my_class /> I would
I have string like \LESSING\root\cimv2:Win32_UserAccount.Domain=LESSING,Name=Admin How to convert it to LESSING\Admin using Framework?
I have string like this: G:\Projects\TestApp\TestWeb\Files\Upload\file.jpg How can I remove all text before Files
i have string stored in python variables, and i am outputting a html that
I have string looking like this: 'Toy Story..(II) (1995)' I want to split the
I have string in which it has Date of type- 'mm-dd-yyyy'; I have 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.