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

  • Home
  • SEARCH
  • 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 8321213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:56:33+00:00 2026-06-08T22:56:33+00:00

My aim I’ve made a custom dialog composed of a scrollable list view on

  • 0

dialog screenshot

My aim
I’ve made a custom dialog composed of a scrollable list view on top and an “OK” button at the bottom. For each row in the list view I’ve put a checkbox and I wish to capture the checkboxes that are selected when “OK” is clicked.

Problem
After checking out some tutorials online as well as some Q&A here, I’ve come up with a basic approach. What I did is

1. in the adapter for the list view, I attach the option name to each checkbox by setTag() when it is created
2. set up an onCheckedChangeListener in the adapter that puts the checked option into an array or remove the option if it’s deselected
3. in the onCreateDialog within the main UI activity attach an OnClickListener to the “OK” button and make it retrieve the options array (obtained in step 2) from the adapter.

It works in the end; but I think it’s too much trouble and not elegant. I thought about using onItemClickListener for the list view or putting a custom view into an AlertDialog (which offers better button/checkbox management), but gave up after some trials.

Is there anyone who can think of a better approach?

  • 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-08T22:56:35+00:00Added an answer on June 8, 2026 at 10:56 pm

    I needed a fairly complex dialog and I ended up writing it as a widget that extends RelativeLayout. When my calendar icon is clicked, it starts an activity which uses the widget, populates days in a calendar, depending on content from a database:

    Calendar Widget

    When you extend a layout, you have complete control over how it sizes itself, layout and what it draws on the canvas.
    The activity implements OnTouchListener to pick up which date on the calendar has been touched – I’m sure the same could apply to adding images and picking up which checkboxes had been selected.

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

Sidebar

Related Questions

my aim is to put a dropdown list into a cell. var obj =
What I can do: I aim to create a view where a User Control
I'm using authorize.net AIM, the sample code they provide prints an ordered list of
Aim to Achieve : I want the Function to accept List(Of String), Array &
I aim to have a similar Bar at the top as here: http://www.keltainenporssi.fi/ The
I aim to have a list of lines where I use the word NB
My aim is to write an app which generates an char - array (each
Aim: to create an Infopath form that displays a list of companies in a
Aim : To try a TCP connection to a list of server and print
The aim is that I have a pair of radio buttons and each pair

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.