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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:56:17+00:00 2026-05-23T21:56:17+00:00

My main view has 4 checkboxes and a submit button. I am trying to

  • 0

My main view has 4 checkboxes and a submit button. I am trying to build a url from the values selected on the checkboxes. Below is the base of my page I am not sure how to program the collection of the checkbox values and submit to my function that does an http call with the checkbox values in the url query.

Any help would be great.

package com.flash_tattoo;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;
import com.flash_tattoo.DataCall;

public class flash_tattoo extends Activity {

    private Button get_images;

    private CheckBox cb1, cb2, cb3, cb4;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


        get_images = (Button)findViewById(R.id.get_images);

            CheckBox[] setOfCheckBoxes = new CheckBox[]
           {
         (CheckBox) findViewById(R.id.checkBox1);
         (CheckBox) findViewById(R.id.checkBox2);        
         (CheckBox) findViewById(R.id.checkBox3);
         (CheckBox) findViewById(R.id.checkBox4);
          };
       for(int i = 0; i < setOfCheckBoxes.length; i++){
       setOfCheckBoxes[i].setOnCheckedChangeListener(BasicCheckListener);
       }


        get_images.setOnClickListener(new OnClickListener() {         
            @Override
            public void onClick(View v){
**//HERE IS WHERE I WANT TO GET THE VALUES OF THE CHECKBOX BUILD AN ARRAY AND THEN PASS THE ARRAY TO MY FUNCTION.**
                String Image_data = DataCall.getJSON();

                  } 
        });

    }

}
  • 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-23T21:56:18+00:00Added an answer on May 23, 2026 at 9:56 pm
    if(cb1.isChecked())
    {
    
      String url = cb1.getText(); //i assumed you have |x| Text <--- checkbox form
    }else if (cb2.isChecked())
    {
        String url = cb2.getText();
    }
    ...and so on...
    

    But why dont you implement setOnCheckedChangeListener() method for each checkbox and whenever any checkbox is checked you get the text from the checkbox by doing only one test if(checkbox.isChecked()) checkbox.getText(), instead of doing tons of ifs

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

Sidebar

Related Questions

My app's main view has a uiwebview. It is white for a split second
I have a main View that has a table which has it's own controller.
In my wpf application the main view has 5 tabs with 5 different usercontrols
View A has a button upon clicking it, we go to view B View
I have an app that has a main view that acts as a view
My app has a login screen before a user goes into the main view.
Im making an app similar to apples weather app. My main view has a
I've got a textView on my main view. I have got a button, on
I'm trying to initialize the values inside a view (created inside a nib file)
I have an iPhone app with a main view that has a UILabel and

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.