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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:23:48+00:00 2026-05-27T17:23:48+00:00

Do checkboxes have the permission to behave like radio buttons.I am developing a quiz

  • 0

Do checkboxes have the permission to behave like radio buttons.I am developing a quiz application where in the options have the behaviour of radio buttons and the icon of the options are to be like the checkbox and is it possible for me to group the checkbox as we group radio buttons?

  • 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-27T17:23:49+00:00Added an answer on May 27, 2026 at 5:23 pm

    I don’t know if this is the best solution but you can create a “manager” for your checkboxes, and run it whenever any of them gets clicked.

    For simplicity I’ve added the manager in the xml code, but feel free to use setOnClickListener, or setOnCheckedChangeListener as well.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
    <CheckBox
        android:id="@+id/checkBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CheckBox1" 
        android:onClick="cbgroupmanager"
        />
    
      ...
    
    <CheckBox
        android:id="@+id/checkBox5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CheckBox5" 
        android:onClick="cbgroupmanager"/>
    
    </LinearLayout>
    

    You need an ArrayList to iterate through, so you can settle the status of each checkbox, whenever any of them gets clicked on.

       public class Q6910875 extends Activity 
    
        ArrayList<CheckBox> cb = new ArrayList<CheckBox>();         
        int CheckBoxNum = 5; //number of checkboxes
        Iterator<CheckBox> itr ;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
    
            cb.add((CheckBox) findViewById(R.id.checkBox1));
            cb.add((CheckBox) findViewById(R.id.checkBox2));
            cb.add((CheckBox) findViewById(R.id.checkBox3));
            cb.add((CheckBox) findViewById(R.id.checkBox4));
            cb.add((CheckBox) findViewById(R.id.checkBox5));
            itr = cb.iterator();
    
        }
    

    And here we have our manager, one iterator to pass trough the whole list, unchecking everything, when it reaches the clicked one, checks!

    public void cbgroupmanager(View v) { 
        CheckBox cbaux;
        while(itr.hasNext()) {
            cbaux = (CheckBox) itr.next(); // we need this because it returns a Object, and we need the setChecked, which is a CheckBox method.
            Log.d("soa", "click");
            if (cbaux.equals(v))     //if its the one clicked, mark it as checked!
                cbaux.setChecked(true);
             else 
                cbaux.setChecked(false);
    
        }
    

    I also could find this other solution linked below, you can change the theme of your checkbox, but I dont have any experience on themes, so I can’t help you any further on this approach.

    Is it possible to change the radio button icon in an android radio button group

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

Sidebar

Related Questions

If I have Checkboxes in page with IDs like below a_chk1, a_chk2, a_chk3, b_chk1,
For example, i have checkboxes: <input type='checkbox' name='fruit' value='apple'> Apple <input type='checkbox' name='fruit' value='orange'>
I have two checkboxes generated like this: <table> <?php foreach ($invited_members as $mem) :
I have set of images and checkboxes like below <form name=food_type_form method=post action=proc.php> <img
Ok, I have a role based permission system in place and would like admin's
This is very strange. I have a gridview with item template checkboxes and buttons
I have a form that is made up of lots of radio buttons and
I have two checkboxes in my code as mentioned below: <input type=checkbox id=event_id name=data[Noncompetitor][event_id][]
I have some mark up like: <input type=checkbox class=fieldapprovalcheckbox data-invoicelineid=3 /> <input type=checkbox class=fieldapprovalcheckbox
I have a set of checkboxes and have disabled few which I want to

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.