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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:58:20+00:00 2026-06-01T01:58:20+00:00

For my particular application, I want to be able to toggle a radiobutton on

  • 0

For my particular application, I want to be able to toggle a radiobutton on and off by touching it, similar to a checkbox. However, I need the radiobuttons to be mutually exclusive within their groups. There are 64 buttons and 8 groups, so I don’t want to use checkboxes and program the toggle functionality manually. Can I use an onTouchListener() with a radiobutton? Is there any way to accomplish this?
Thank you in advance for any support.

  • 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-01T01:58:22+00:00Added an answer on June 1, 2026 at 1:58 am

    You are looking for a UI paradigm that is neither a checkbox nor a radio button. Your best bet is to use check boxes and then implement the mutual exclusivity on top of that. e.g.,

    myCheckbox1.setOnCheckChangedListener(new OnCheckChangedListener() {
      @Override
      public void onCheckChanged(CompoundButton buttonView, boolean isChecked) {
        if (isChecked) {
          myCheckbox2.setChecked(false);
          myCheckbox3.setChecked(false);
          myCheckbox4.setChecked(false);
    
          // start playback
        } else {
          // stop playback
        }
      } 
    );
    

    Note that if you are able to enumerate all of the button IDs per group, you can write the code generically, like,

        if (isChecked) {
          int myGroup = (Integer) buttonView.getTag(); // Define the group in the view's tag
          for (int id: groups.get(myGroup)) {
            if (id != buttonView.getId()) ((CompoundButton) findViewById(id)).setChecked(false); 
        }
    

    The other, more complicated answer would be to build your own UI widget and give it whatever semantics you want. That’s not scope of what I could describe here though.

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

Sidebar

Related Questions

i want to start an application on receiving sms from a particular number. i
I wrote an application which will be able to open files of particular extension
I need my application (Master) to run another application (Worker) on a particular event.
I am creating generic reporting logic for my application and want to be able
I am currently developing an application where I want to be able to have
I have a particular application that needs to calculate something very specific, and while
For a particular application using bitwise masks to store a value, I'd like to
I like Django, but for a particular application I would like to use only
I have a particular web application that like most others, has to account for
In the application I am developing I have to store the time some particular

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.