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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:37:36+00:00 2026-05-23T02:37:36+00:00

new Android developer here. I’m doing a form that let’s users set up some

  • 0

new Android developer here. I’m doing a form that let’s users set up some search criteria before searching in a SQLite db. Part of the form includes some checkboxes. How do I go about their values in a “best practice” sense?

I’m used to doing PHP, so I would set up a method that returns an array or object with all the values, and then call that inside the ‘onClick’ method, but is that also a good idea in Java?

My code looks like this:

    // Setup a listener, and event handler for the onClick event of the button
    buttonFind.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // Perform action on click
            String text = "Button clicked";
            int duration = Toast.LENGTH_SHORT;
            Context context = getApplicationContext();

            Toast toast = Toast.makeText(context, text, duration);
            toast.show();
        }
    });
  • 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-23T02:37:37+00:00Added an answer on May 23, 2026 at 2:37 am

    It’s probably better to give more details in your question. You don’t show anywhere in your code where you define your checkbox… so i’m going to make some assumptions:

    I’ll assume that somewhere in your onCreate() method of your activity you have something that looks like this:

    CheckBox myCheckbox = (Checkbox) findViewById(R.id.my_checkbox);
    

    If you want to find out if the checkbox is checked or not from your button’s onClick() method (since you posted it above), you can do something like this:

    boolean isMyCheckboxChecked = myCheckbox.isChecked();
    

    Hope that works out for you. Next time try to be more clear in your questions.

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

Sidebar

Related Questions

New Android developer here - I'm hoping this is simple. I want to create
New Android developer here. I'm following a tutorial at http://www.vogella.de/ . The first applications
Extreme Android developer newbie here...well, new to Android development, not development in general. I
New Android developer here; well versed in Java. I'm looking to create a playlist
I want to learn some programming for my android phone. I was successful doing
New to Android before I port my application to this platform I wanted to
Quick note: I'm using the SoundPool class http://developer.android.com/reference/android/media/SoundPool.html What I have here is a
I am a new android developer trying to code a widget.. The updatePeriodMillis parameter
Aloha, I've been following the guidelines here: http://developer.android.com/resources/tutorials/testing/helloandroid_test.html To create some simple test cases
i am new developer in android applications.i would like to save the data using

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.