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

The Archive Base Latest Questions

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

For an Android App, I’m using a GridView and extending BaseAdapter to organize its

  • 0

For an Android App, I’m using a GridView and extending BaseAdapter to organize its contents. For the function getView that I override in my extended BaseAdapter class, I create a LinearLayout, which I attach an ImageView and 3 TextViews to. Now, I need to implement convertView, but because I created my views programmatically, I didn’t think I can use findViewById to find these child views to change their properties (like text and bitmaps).

I had the idea of assigning a unique ID pertaining to different types of views for each one when I create them (example: give my name textview the id of 1, description textview the id of 2, etc), but I was not sure if the ids have to be unique among every view, whether they’re the same kind of view or not.

Ultimately, how do I find a child view that’s part of a linearlayout view which were all created programmatically?

  • 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-30T22:09:05+00:00Added an answer on May 30, 2026 at 10:09 pm

    You can get children of LinearLayout via getChildAt() but it’s hard to distinguish what child exactly you get.

    I think assigning IDs is better way. You can assign IDs to your views and later get views via findViewById(). IDs doesn’t need to be unique for each LinearLayout.

    Something like this:

    // Give more sensible names to ID's
    int IMAGEVIEW_ID = 0;
    int TEXTVIEW1_ID = 1;
    int TEXTVIEW2_ID = 2;
    int TEXTVIEW3_ID = 3;
    
    imageView.setId(IMAGEVIEW_ID);
    textView1.setId(TEXTVIEW1_ID);
    textView2.setId(TEXTVIEW2_ID);
    textView3.setId(TEXTVIEW3_ID);
    
    ...
    // somewhere later
    ImageView imageView = (ImageView) convertView.findViewById(IMAGEVIEW_ID);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Android app stores its SQLite database on the SD card, so that when
My Android app, which uses a TabActivity to display its contents, has 4 tabs
I created a native Android app that basically hosts a webView control. That webView
i've developed an android app that's fetches an xml file and displays this data
My android-app gets List in the one activity, but activity,that contains the LisView for
Every activity within my android app is generated using HTML. When one of the
My Android app has a button that executes this code in order to open
My Android app has a tab bar that uses an Intent to launch the
My android app works on landscape mode. I have a listview that contains some
My Android app is getting called by an intent that is passing information (pendingintent

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.