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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:23:30+00:00 2026-06-14T14:23:30+00:00

In my application, I have some text for terms and conditions. By registering you

  • 0

In my application, I have some text for terms and conditions.

By registering you agree to be bound by our Terms of Use and that you have read our Privacy Policy.

The words Terms of Use and Privacy Policy should be clickable, and display an alert box.

First I tried splitting the sentences into four TextViews:

  1. By registering you agree to be bound by our
  2. Terms of Use
  3. and that you have read our
  4. Privacy Policy.

This worked well, with the following layout XML:

 <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/termsandcondtion"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:orientation="horizontal" >

        <TextView
            android:id="@+id/terms_1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/terms_1"
            android:textColor="#000000"
            android:textSize="12dp" />

        <TextView
            android:id="@+id/terms"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:onClick="showTerms"
            android:text="@string/terms_2"
            android:textColor="#000000"
            android:textSize="12dp" />

        <TextView
            android:id="@+id/terms_3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/terms_3"
            android:textColor="#000000"
            android:textSize="12dp" />

        <TextView
            android:id="@+id/termsofuse"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:onClick="showTermsofUse"
            android:text="@string/terms_4"
            android:textColor="#000000"
            android:textSize="12dp" />
    </LinearLayout>

The code for displaying the popup is:

WebView wv = new WebView(this);

    wv.loadUrl(url);

    wv.setWebViewClient(new WebViewClient()
    {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url)
        {
            view.loadUrl(url);

            return true;
        }
    });
    AlertDialog.Builder alert = new AlertDialog.Builder(this);

    alert.setTitle("Privacy Policy");
    alert.setView(wv);
    alert.setNegativeButton("Close", new DialogInterface.OnClickListener()
    {
        public void onClick(DialogInterface dialog, int id)
        {
        }
    });
    alert.show();

The problem is that the four TextViews are not properly aligned with each other.
This means I have to use one TextView and display a pop-up diaplog when a particular word (Terms of Use, Privacy Policy) in TextView is clicked.

What is the best way to do this?

  • 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-14T14:23:31+00:00Added an answer on June 14, 2026 at 2:23 pm

    I think you will need Spannable Strings. Also, this question would help. Creating ClickableSpan will be a good choice for your problem.

    SpannableString stringToSpan = new SpannableString("<your sentence>");
    TextView textView = (TextView) findViewById(R.id.<yourTextView ID>);
    textView.setText(stringToSpan);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    ClickableSpan clickableSpan = new ClickableSpan() {
          @Override
          public void onClick(View textView) {
           //alert box code here
           }
          };
    stringToSpan.setSpan(clickableSpan, <start position of span>,<end position>,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some text area field in my grails application. I got the following
I have some text views in an linear layout in my android application. Next
Hi All, I have a web-view in my application which displays some text with
I have an application that gets terms from a DB to run as a
If I have some text in a String, how can I copy that to
I'm working on an application that's printing out some text to the user in
I have some text in a Flex 3 application defined as follows <mx:Text id=textbutton
I have a long-running console-based application Sender that sends simple text to STDOUT using
In my application,i have some .strings files.And on a button click,which is on my
In my Python application I have some GtkMenuItems (associated with the main GtkMenuBar), and

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.