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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:00:19+00:00 2026-06-15T15:00:19+00:00

I just set up my ArrayAdapter to convertView to my favor , but now

  • 0

I just set up my ArrayAdapter to convertView to my favor , but now I wonder how to control the children of the LinearLayouts am using in that listview , lets say I have a TextView in the Linearlayout , I want to call setText , but I don’t know how , or maybe I have a button which I want to call setOnClickListener , I don’t know how !

Here is my getView code :

@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub

        if (convertView == null){
            convertView = inf.inflate(R.layout.normal_row, parent , false);
        }
        switch(position){
        case(0):
            // here is where my first LinearLayout goes , containing an Image and Switch which I need to program in onCheckedChangeListener ...
            convertView = (LinearLayout) inf.inflate(R.layout.row_switch, parent,false);

            break;

        case(1)
        // here I need to set the Text for the following two options on some basis , they are both linearLayouts containing a single textView which I want to call setText for each case  1 and 2.
             break;
            case(2)

        }
  • 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-15T15:00:20+00:00Added an answer on June 15, 2026 at 3:00 pm
    TextView textview = (TextView) convertView.findById(R.id.txt); 
    text.setText("textview");
    
    Button btn  = (Button) convertView.findById(R.id.btn); 
    
    btn.setTag(textview); 
    
    btn.setOnClickListener(...)
    {
       onClick(..){
          TextView t = (Textview)btn.getTag():
          t.setText("new value")
    
       }
    }
    

    i suggest you to look at the question which i replied before.

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

Sidebar

Related Questions

I just set up a background for this app I'm making, but now it
I just set up CVS on my local machine. But now I need to
I just set up my new homepage at http://ritter.vg . I'm using jQuery, but
I just set up a simple virtual server with Debian netinst. Now I want
I have a CRON job php script that I just set up not too
I have a ListView of items that need to be checkable/uncheckable. I have set
Ive just set up some basic models using scaffold with Rails, i've edited the
I want to set a background image to my listview so that regardless of
I just set up a server in my house using private IP. I can
I just set up an admin module with a grid view using the module

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.