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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:31:27+00:00 2026-06-13T08:31:27+00:00

From the code below (In ExpandableView Adapter) how can I get group id after

  • 0

From the code below (In ExpandableView Adapter) how can I get group id after I click on the image (iv).
If user click on the Group list I want to expand it as it usual, but if user click on the image in the Group list I want to invoke some other action and the SampleGroup’s id is needed.

public View getGroupView(int groupPosition, boolean isExpanded, View converView, ViewGroup parent){

     SampleGroup group = (SampleGroup)getGroup(groupPosition);

     if(convertView == null){
          LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = layoutInflater.inflate(R.layout.list_group, null);
     }

     ImageView iv = (ImageView)convertView.findViewById(R.id.some_iv):
     TextView tv = (TextView)convertView.findViewById(R.id.some_tv);

     iv.setImageDrawable(group.getImage());
     iv.setOnClickListener(onClickLintener);
     tv.setText(group.getText());
}


OnClickListener onClickLintener = new OnClickListener() {
    @Override
    public void onClick(View v) {
        //How to get group id here???
    }
};

public class SampleGroup{
     private int id;
     private String name;
     private Drawable image;

     public SampleGroup(int id, String name, Drawable image){
          this.id = id;
          this.name = name;
          this.image = image;
     }

     public int getId(){
          return id;
     }

     public void setId(int id){
          this.id = id;
     }

     public String getName(){
          return name;
     }

     public void setName(String name){
          this.name = name
     }

     public Drawable getImage(){
          return image;
     }

     public void setImage(Drawable image){
          this.image = image
     }
}
  • 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-13T08:31:28+00:00Added an answer on June 13, 2026 at 8:31 am

    try this one:

    public View getGroupView(int groupPosition, boolean isExpanded, View converView, ViewGroup parent){
      ......
      ImageView iv = (ImageView)convertView.findViewById(R.id.some_iv);
      iv.setTag(group.id);
    }
    

    then

    OnClickListener onClickLintener = new OnClickListener() {
      @Override
      public void onClick(View v) {
          //How to get group id here???
          int groupId = (Integer) v.getTag();
      }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can get the first record back from the code below in SQL Server
From the code below or ValueMutationEventHandler , why can't I do future2.get(), wait for
as you can see from the code below im just trying to get the
I have some really funky code. As you can see from the code below
What i want is that each animation, from the code below, to start with
From the disassembly code below can I assume that the location 43E010 is a
How can I correct the problem I keep getting from the code below which
I get a very common crash below from the code below. I thought my
As you can see from the code provided below as well as the title,
As you can see from the code below we, use TinyMce a lot in

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.