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

The Archive Base Latest Questions

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

I tried following the following example to make an HTTP link in my TextView

  • 0

I tried following the following example to make an HTTP link in my TextView in my alert dialog clickable, but it does not work:

How do I make links in a TextView clickable?

The only way I can get it to work is if I put the text of the link directly into my string and put android:autoLink="web" into my TextView. But I do not want to see the whole link, just the name.

Here is where my dialog is created:

@Override
protected Dialog onCreateDialog(int id) {
    LayoutInflater factory = LayoutInflater.from(this);

    switch (id) {
    case DISCLAIMER:
            final View disclaimerView = factory.inflate(R.layout.disclaimer_dialog, null);
            final TextView dtv = (TextView) disclaimerView.findViewById(R.id.disclaimer_body);

            dtv.setText("v"+versionName+"\n\n\u00A9"+Calendar.getInstance().get(Calendar.YEAR)+" "+"Developer\n\n" +
                getString(R.string.alert_dialog_disclaimer_body));

            dtv.setMovementMethod(LinkMovementMethod.getInstance());                

            return new AlertDialog.Builder(MyActivity.this)                
                .setView(disclaimerView)
                .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                    }
                })
                .create();
    }

    return null;
}

Here is my TextView located in R.layout.disclaimer_dialog:

<TextView
    android:id="@+id/disclaimer_body"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="5dp"
    android:layout_marginBottom="10dp"
    android:gravity="center"
    />

Here is my string resource:

<string name="alert_dialog_disclaimer_body">This application was developed and written by me.\n\nGraphs use AChartEngine licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.\n\nThe rest goes here.</string>
  • 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-06T18:31:16+00:00Added an answer on June 6, 2026 at 6:31 pm

    The documentation to TextView.setText(CharSequence) explains:

    Sets the string value of the TextView. TextView does not accept HTML-like formatting, which you can do with text strings in XML resource files. To style your strings, attach android.text.style.* objects to a SpannableString, or see the Available Resource Types documentation for an example of setting formatted text in the XML resource file.

    And following their suggestion, Formatting and Styling explains, under the Styling with HTML markup heading, how you can have both HTML markup and formatting codes.

    I think the easiest thing in your situation would simply be to adjust your layout to have your copyright notice in one View that you use as you already are, and put the disclaimer below in a second View that you simply leave alone:

    <TextView
        android:id="@+id/disclaimer_body"
        android:text="@string/alert_dialog_disclaimer_body"
        ...
        />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to make a file choose following the below link http://www.dreamincode.net/forums/topic/190013-creating-simple-file-chooser/ However, I
I tried following the gradle manual with their example like this but copyJars is
I tried following the instruction s but can't get the plugin to work, the
Example: http://jsfiddle.net/NBWmU/1/ I'm using the following CSS to make the background of my div
I am trying to make the following example of a progress scrollbar vertical: http://flowplayer.org/tools/demos/rangeinput/scrollbar.html
I need to rewrite the following URL: http://example.com/folder/subfolder/filename to http://example.com/folder/subfolder/filename.txt I've tried the following:
I tried to make use of $_SERVER , but it didn't work for me.
I tried the following example for applying a linear gradient: GradientPaintDemo2D . It works
In the following example (apologies for the length) I have tried to isolate some
In the following example, I tried to use uninterpreted Boolean function like (declare-const p

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.