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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:04:42+00:00 2026-05-30T07:04:42+00:00

I have a ListView with custom_row , every row has a textView1 and a

  • 0

I have a ListView with custom_row , every row has a textView1 and a textView2 , the list has now 2 records , and i have a button that is not on the list.
When i click the button i want to get the text from textView2 of the 2 records.
Is it possible?

  • 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-30T07:04:43+00:00Added an answer on May 30, 2026 at 7:04 am

    I would take a shortcut, you ListView is being populated by an Adapter that uses a dataset. This dataset can be almost any datastructure such as Array, ArrayList, etc.

    The layout you define, such as custom_row in you case only defines the structure of your view i.e. “where” items will show within on item on the list.

    On the other hand, it is still your responsibility to tell the ListView “what” to show within the textView1 and textView2. You do this using the Adapter which connects the ListView to the dataset. More often than not, the ListView is a one-to-one mapping of the dataset i.e. the first item on the list is the first item in you dataset (I don’t know what you are using for only two items, might be an array).

    The ListView calls getCount() on the Adapter to find out how many total views there will be. It then call getView() for each view to be shown on the screen. It is in this method that you define what will actually show in a single view on the list (your custom_row).

    Now you would know which entry of the dataset is supposed to populate which view in the ListView so you can just read it off there. For example, if your getView() does:

    textView2.setText(getItem(position).getSomeTextField());
    

    And the original dataset is an ArrayList named listDataSet

    You could just do listDataSet.get(2).getSomeTextField()

    NOTE: You will have to manage the scope of the dataset so that it’s visible from wherever you are calling.

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

Sidebar

Related Questions

i have a listView with a custom BaseAdapter.Every list item has a clickable button.
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have a listview with custom rows and that extends SimpleAdapter. Each row consist
i have a ListView with a custom Servizio object in every row. I'm using
I have a custom listview row whose XML has one ImageView and three TextViews
I am using ListView and for every row I have row_item.xml and I inflate
I have got ListView with a custom Adapter. Every row contains clickable buttons and
I have a custom listview row that contains a number of textView components. Instead
I have a listView using a custom adapter. Each row contains a button and
I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter

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.