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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:37:16+00:00 2026-06-16T20:37:16+00:00

I am using expandable list view in my app and in its child view,i

  • 0

I am using expandable list view in my app and in its child view,i am using a custom list of radio buttons.The problem here is that i want to make sure that only one radiobutton should be selected at a time.If one radio button is selected,other should be deselected.This is the code i am using:

@Override
    public View getChildView(int groupPosition,int childPosition,
            boolean isLastChild, View convertView, ViewGroup parent)
    {
        m_position = childPosition;

        View l_view = convertView;
        if (l_view == null) 
        {
            LayoutInflater l_vi = (LayoutInflater)m_context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            l_view = l_vi.inflate(R.layout.singleradiobutton, null);

            ViewHolder viewHolder = new ViewHolder();
            viewHolder.l_nameRadioButton = (RadioButton) l_view.findViewById(R.id.radioButton);

            l_view.setTag(viewHolder);
        }

        EnteringValuesToArrayList l_enteringValuesInstance = m_itemsOfAdapterArrayList.get(childPosition);
        String l_nameOfContact = l_enteringValuesInstance.GetNameOfEntry();

        if (l_nameOfContact != null)
        {
            ViewHolder holder = (ViewHolder) l_view.getTag();

            if (holder.l_nameRadioButton != null) 
            {
                holder.l_nameRadioButton.setText(l_nameOfContact);
            }

            if(m_timerValue != 0 && l_enteringValuesInstance.GetTimerValueOfEntry() == m_timerValue)
                holder.l_nameRadioButton.setChecked(true);
            else
                holder.l_nameRadioButton.setChecked(false); 

            holder.l_nameRadioButton.setOnClickListener(new OnItemClickListener(childPosition,holder.l_nameRadioButton.getText(),holder.l_nameRadioButton));          
        }
        return l_view;
    }

    private class OnItemClickListener implements OnClickListener
    {           
        private int l_positionOfItemClicked;
        private CharSequence l_text;
        private RadioButton l_radioButton;
        OnItemClickListener(int position, CharSequence text,RadioButton l_nameRadioButton)
        {
            this.l_positionOfItemClicked = position;
            this.l_text = text;
            this.l_radioButton = l_nameRadioButton;
        }
        @Override
        public void onClick(View arg0) 
        {
            l_radioButton.setChecked(true); 
        }
    }

I searched a lot,but did not get the solution of the problem.Please help me.Thanks in advance.

  • 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-16T20:37:17+00:00Added an answer on June 16, 2026 at 8:37 pm

    Similar question is asked in this How to use RadioGroup in ListView custom adapter?

    You can create a custom view in your case.

    Hope this helps.

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

Sidebar

Related Questions

i want to create vertical expandable list view using java script.like here click .If
I'm using Expandable List view. In my app both the group and child have
in my android app i am using expandable list view to display some text.These
I am using expandable list view with checkboxex. I need to check all child
I want to set new style for expandable list view in my Android app.
I have seen in some places that while using Expandable List View we register
I'm using an expandable list view to display folders and files that are in
I am trying to take an expandable list view that I have already created
I am using an expandable list view . When i click on a parent
I've inherited some code with an expandable list view with a custom adapter. I'm

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.