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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:39:44+00:00 2026-05-25T00:39:44+00:00

I am using Linkify in my app, and visited link text is appearing as

  • 0

I am using Linkify in my app, and visited link text is appearing as dark purple. My overall layout background color is dark blue so this is impossible to read. The text is set as white, but visited links are appearing as dark purple. How do I override this?

<TextView android:text="Website:" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content"
          android:textSize="14dip"
          android:paddingBottom="2dip"
          android:background="#ffffff"
          android:textColor="#577dbe" />              
<TextView android:text="http://www.mysite.com/"
          android:layout_width="match_parent" 
          android:layout_height="wrap_content"
          android:textSize="12dip"
          android:paddingBottom="6dip"
          android:textColor="#ffffff"
          android:id="@+id/contactWeb1" />  
  • 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-25T00:39:45+00:00Added an answer on May 25, 2026 at 12:39 am

    It turned out to be a simple solution!

    However you won’t be able to do the visited / not visited differentiation.

        TextView contactWeb1 = (TextView) findViewById(R.id.contactWeb1);
        noteView.setText("http://www.blablaasd.com/");
        noteView.setLinkTextColor(Color.red); //for example
        Linkify.addLinks(noteView, Linkify.ALL);
    

    My attempts to catch visited states:

    Use

        noteView.setLinkTextColor(getResources().getColorStateList(R.color.colors));
    

    Instead of

        noteView.setLinkTextColor(Color.red);
    

    In res/ create folder color and create colors.xml in res/color/

    colors.xml

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item
          android:state_window_focused="true" android:color="#00ff00">
            
        </item>
        <item
          android:state_window_focused="true" android:color="#00ff00">
            
        </item>
        <item android:color="#FF00ff"/>
    </selector>
    

    I have tried my best to catch visited states. I tried all the states a selector can take.

    I might have missed In case you found out, share (:


    ALTERNATE SOLUTION (works only for html links)

    Set the font Color programatically

    Drawback (Be carefull for this point)

    • You will have to catch whether it was visited or not (this is doable)

      This means that you are not overriding the visited links functionality.

    CODE:

    TextView contactWeb1 = (TextView) findViewById(R.id.contactWeb1);
    String desc = "<font color=\"red\"><a href='http://www.mysite.com/'>Visit my site</a></font>";
    contactWeb1.setText(Html.fromHtml(desc));
    contactWeb1.setMovementMethod(LinkMovementMethod.getInstance());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this great plugin: https://github.com/maranomynet/linkify/blob/master/1.0/jquery.linkify-1.0.js to link text manipulating the dom. The problem
I'm using Linkify to add links to static text... This is what I'm using:
i am using following code in my app: import android.app.Activity; import android.os.Bundle; import android.text.Html;
Possible Duplicate: How do I linkify text using ActionScript 3 I am using a
https://github.com/maranomynet/linkify I'm using this plugin. It works, and everything's fine. But is there an
I'm using this jquery plugin: https://github.com/maranomynet/linkify/blob/master/1.0/jquery.linkify-1.0.js With this REGEX plugins I'm trying to linkify
I'm using a short snippet of linkify derived code to access all the text
in my android app i am using expandable list view to display some text.These
using the jquery ui modal dialog , the background shades grey (i assuming this
I seem to be having trouble with the linkify I am using in 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.