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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:27:05+00:00 2026-05-26T18:27:05+00:00

For example I have my custom ExpandableListAdapter extends BaseExpandableListAdapter, it has two groups. public

  • 0

For example I have my custom ExpandableListAdapter extends BaseExpandableListAdapter, it has two groups.

    public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
            ViewGroup parent) {
        if (convertView == null) {
            convertView = infalInflater.inflate(R.layout.rowgroup, parent, false);
        }
        s++;
        Log.d("Index", String.valueOf(s));
        return convertView;
    }

First question: Why this code will always return in LogCat Index = 1, Index = 2, Index = 3, … , Index = 10?

public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
            ViewGroup parent) {
        if (convertView == null) {
            s++;
            Log.d("Index", String.valueOf(s));
            convertView = infalInflater.inflate(R.layout.rowgroup, parent, false);
        }
            return convertView;
        }

Second question: Why this code will return in LogCat Index = 1, Index = 2, Index = 3? I have only 2 groups, not 3. If I add one more group, the Index value will be 4. I set breakpoint in convertView = infalInflater.inflate(R.layout.rowgroup, parent, false); line and I saw that getGroupView with groupPosition==0 executed at the beginning and at the end.

It is my mistake or so it should be? I want to understand why this’s happening =)

Thanks for the answers!

  • 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-26T18:27:06+00:00Added an answer on May 26, 2026 at 6:27 pm

    I think that I found the answer here =) Before that I do not understand how it works.

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

Sidebar

Related Questions

I have a custom c# type like (just an example): public class MyVector {
For example, I have a custom control called SampleControl. To simplify things for this
I have a string variable that represents the name of a custom class. Example:
Example: I have two shared objects (same should apply to .dlls). The first shared
I have a class which has the following constructor public DelayCompositeDesigner(DelayComposite CompositeObject) { InitializeComponent();
I have custom control - chart with size, for example, 300x300 pixels and more
I have defined a custom object with multiple fields. For example say I have
Let's say I have a custom control which wraps another control (for example MyCustomButton).
Example: I have 10 view controllers, which are all allocated and initialized in the
sometimes Flash Authoring colors my actionscript inappropriately. for example: i have custom variable 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.