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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:10:18+00:00 2026-05-14T05:10:18+00:00

I have a screen where you can enable/disable modules for my Android application. For

  • 0

I have a screen where you can enable/disable modules for my Android application.

For this I use a CheckboxPreference screen. This is all good, but the summary field gets cut off if longer descriptions are added than 2 lines.

Suppose I have 4-5 lines of description available for each module, I would like to display this in a helper window.

I tried to bind a click event to the CheckboxPreference, but that fires for the whole line, so not only when the checkbox is clicked, and more, wherever you click on the line the checkbox is toggled.

So now I am wondering if this can be fixed. So if the user needs more info, just taps the text and the helper opens up, and if want to toggle the settings it taps the checkbox.

How would you do it? I am open to other ideas too, if they do work.

  • 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-14T05:10:19+00:00Added an answer on May 14, 2026 at 5:10 am

    Hmn had the same problem today.
    My alternative solution is to just allow to display more Text within the summary.

    Just create your own subclass of CheckBoxPreference that looks something like this:

    public class CheckBoxPreferenceWithLongSummary extends CheckBoxPreference{
    
        public CheckBoxPreferenceWithLongSummary(Context context) {
            super(context);
        }
    
        public CheckBoxPreferenceWithLongSummary(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
        public CheckBoxPreferenceWithLongSummary(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
        }
    
        @Override
        protected void onBindView(View view) {
            super.onBindView(view);
            TextView summaryView = (TextView) view.findViewById(android.R.id.summary);
            summaryView.setMaxLines(10);
        }
    }
    

    Then within your PreferenceScreen (i assume you use xml to set up the Preference layout – not sure if its even possible completely programmatically) just replace the old <CheckBoxPreference.../> with your new implementation like <com.example.whatever.CheckBoxPreferenceWithLongSummary ... />

    Seems to work just fine for me, altough i’m not sure about the findViewById(android.R.id.summary) because in the parentClass com.android.internal.R.id.summary is used which seems to be not directly accessible from within Java? Hope its not just an coincidence 🙂

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

Sidebar

Related Questions

I have a Silverlight application running full screen. Is there a way i can
I have list of screen names that can be filtered by letter. The Issue
I have a several actions that can be taken on the screen that would
I have a datagridview displayed on the screen. The user can change the end
How can you combine two windows in Screen? I have two windows such that
I I have read this url first official and this another blog But they
I am attaching an image. Some of you might have tried this iphone application
I would like to enable HD video playback for my Java Swing application but
I have tried to find a way to disable the PatternLock screen temporarily. I
On iOS 5 with an iPad 2 or iPhone 4S, users can enable screen

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.