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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:05:30+00:00 2026-05-24T17:05:30+00:00

I have a custom listadapter with an image and text at each level. I

  • 0

I have a custom listadapter with an image and text at each level. I want to get the text of the selected level.

 public View updateView(View view, TreeNodeInfo<Long> treeNodeInfo) {
            final LinearLayout viewLayout = (LinearLayout) view; 
            final TextView descriptionView = (TextView) viewLayout.findViewById(R.id.item);
            final ImageView img = (ImageView)viewLayout.findViewById(R.id.image);




return viewLayout;  }

In my activity class i have a clicklistener on the list.

 customlist.setOnItemClickListener(new OnItemClickListener(){
                        @Override
                        public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id){
                             //dostuff
                        }
                    }); 

(TextView)view.findViewById(R.id.item);

returns only the text for the first item only and not any other selected item on the list.

How do i get the text of the selected item.??

.

  • 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-24T17:05:31+00:00Added an answer on May 24, 2026 at 5:05 pm

    Use the underlying data used to bind the text to the text view, update that data, and notify the ListView that the data changed.

    For example
    List<Map<String,String> data = new List<Map<String,String>>();
    // a bunch of add's
    
    adapter = new SimpleAdapter(Activity.this, data, R.layout.list_item, 
          new String{TEXT1, TEXT2, TEXT3, IMG1}, 
          new int[] {R.id.text1, R.id.text2, R.id.text3, R.id.IMG1});
    // set adapter
    
    // ...
    
    onListItemClick(..., int position, long id){
    Map<String,String> item = data.get(position);
       item.put(TEXT1, updatedText1String);
       item.put(TEXT2, updatedText2String);
       item.put(TEXT3, updatedText3String);
       listView.notifyDataSetChanged();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a custom listview with two rows of text in each item,
I have Custom List to display image with it's name like below... public class
I have a view that has a custom ArrayAdapter as a ListAdapter. Customer is
I have custom classes that I currently instantiate within App.xaml as resources. I want
I currently have a simple list view adapter that holds two rows of text.
I have implemented a custom list view which looks like the twitter timeline. adapter
I have custom code inside of a SSRS report that needs to get the
Do I need to load my custom ListAdapter in another thread? I have done
I have a custom listview and I am using a custom listadapter to display
I have a Custom ListView created from XML Layout. I want to bind that

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.