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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:55:16+00:00 2026-05-23T09:55:16+00:00

Is there a way to create an instance of a TextView on a separate

  • 0

Is there a way to create an instance of a TextView on a separate layout? I have created an ExpandableListView with x number of objects. I would like to display one of the children in the collapsed group as well. I realize I could set up in the code, however it would be much easier, and much cleaner if I could just point to the same id R.id.dscItem multiple times.

I have tried dropping the + in “@+id/dscItem”so that it was “@id/dscItem” but it didn’t do much. Is it true that I can only point to this id once!?

SimpleExpandableListAdapter mAdapter = new SimpleExpandableListAdapter(
            this, createGroup(), R.layout.exprow, R.layout.row,
            new String[] { Items.ITEMS_ITEM }, new int[] { R.id.txtItem },
            createChildren(), R.layout.exprow, new String[] {
                    Items.ITEMS_DESC, Items.ITEMS_MANU },
            new int[] { R.id.dscItem, R.id.manuItem });

XML layout 1:

></TextView>
<TextView 
android:text="Description" 
android:id="@id/dscItem"
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:textSize="15dip"

></TextView>

XML layout 2

<TextView 
android:text="Description" 
android:id="@+id/dscItem" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:textColor="#994020"
android:layout_gravity="right"

></TextView>
  • 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-23T09:55:17+00:00Added an answer on May 23, 2026 at 9:55 am

    You can create a textview in a separate layout and use it by layout merge in xml or layout inflater in java code
    http://developer.android.com/resources/articles/layout-tricks-merge.html

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

Sidebar

Related Questions

Is there a way to have MSBuild create an instance of IIS on another
Is there any way to create all instance properties dynamically? For example, I would
I created a page--front.tpl.php successfully. Is there a similar way to create an instance
Is there a way to create an instance of a class based on the
Is there a way to create C# objects and call methods from unmanaged C++,
In Java, is there any way to create an instance of any class that
Is there a way to create a only instance in a class? At this
Is there a way to create aliases for instance variables (not talking about db
Is there a way I can create a virtual instance of gcc compiler on
Is there a way to create an instance of HttpPostedFile with Reflection. I tried:

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.