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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:33:51+00:00 2026-06-13T10:33:51+00:00

I have a vertical LinearLayout and TextView. File: unitdetails.xml <LinearLayout android:id=@+id/unit_details_person android:layout_width=match_parent android:layout_height=wrap_content android:layout_below=@id/unit_person_header

  • 0

I have a vertical LinearLayout and TextView.

File: unitdetails.xml

<LinearLayout
  android:id="@+id/unit_details_person"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_below="@id/unit_person_header"
  android:orientation="vertical" />

File: person_phone.xml

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:layout_weight="0"
    android:background="@android:color/darker_gray"
    android:singleLine="true"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:paddingLeft="15dp"
    android:text="Some text">
</TextView>

I add TextView in my Activity code

while (iterator.hasNext()) {

            Person person = iterator.next();

            TextView positionTV = (TextView) getLayoutInflater().inflate(R.layout.person_position, null);
            TextView personTV = (TextView) getLayoutInflater().inflate(R.layout.person_person, null);
            TextView phoneTV = (TextView) getLayoutInflater().inflate(R.layout.person_phone, null);
            TextView emailTV = (TextView) getLayoutInflater().inflate(R.layout.person_email, null);

            positionTV.setText(person.getPosition());
            personTV.setText(person.getPerson());
            phoneTV.setText(person.getPhone());
            emailTV.setText(person.getEmail());

            Linkify.addLinks(phoneTV, Linkify.PHONE_NUMBERS);
            Linkify.addLinks(emailTV, Linkify.EMAIL_ADDRESSES);

            personLinearLayout.addView(positionTV);
            personLinearLayout.addView(personTV);
            personLinearLayout.addView(phoneTV);
            personLinearLayout.addView(emailTV);
        }

After adding, TextView is extend whole screen width and system start dialer when I click on the right side of phone number.

  • 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-13T10:33:52+00:00Added an answer on June 13, 2026 at 10:33 am

    Have you tried to set the params programmatically like this:

    myTextView.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    

    and remove the

    android:layout_weight="0"
    

    Which is useless here?

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

Sidebar

Related Questions

quiz_list.xml : My xml file <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical> <TextView android:id=@+id/question android:layout_width=fill_parent android:layout_height=wrap_content
If I have one layout file => res/layout/item.xml : <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following main.xml file with a LinearLayout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following XML code for my cells (search_cell.xml) : <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have this layout file in my android application: <?xml version=1.0 encoding=utf-8?> <TabHost xmlns:android=http://schemas.android.com/apk/res/android
I have LinearLayout in my xml file that I am trying to add a
i have in my android main.xml file as the following.. when i run it
Please have a look at the following android xml file which is responsible for
I have a simple vertical LinearLayout in which there is a button on the
I have 2 xml files, a main file where I have a listView 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.