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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:30:34+00:00 2026-05-27T14:30:34+00:00

I have a PreferenceActivity with two checkboxes. Everything is working correctly, but I have

  • 0

I have a PreferenceActivity with two checkboxes. Everything is working correctly, but I have a UI problem; not all of the text for the checkbox fits onto the checkbox row.

Is there a nice way to set the minimum height for these checkbox preferences without hardcoding a value?

EDIT – adding xml:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
   <CheckBoxPreference
      android:key="alarm_set"
      android:title="@string/set_alarm_title"
      android:defaultValue="true" />
   <CheckBoxPreference
      android:key="store_pages"
      android:title="@string/store_downloaded_pages_title"
      android:summary="@string/store_downloaded_pages"
      android:defaultValue="false" />
</PreferenceScreen>
  • 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-27T14:30:35+00:00Added an answer on May 27, 2026 at 2:30 pm

    Based off this question about text preference having the same iussue I use this class.

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

    In the xml it then looks like this.

        <com.iforpowell.android.ipbike.LongSummaryCheckBoxPreference android:key="@string/key_distance_line_enable"
            android:title="@string/title_distance_line_enable" android:summary="@string/summary_distance_line_enable"
            android:defaultValue="true" />
        <com.iforpowell.android.ipbike.LongSummaryCheckBoxPreference android:key="@string/key_altitude_line_enable"
            android:title="@string/title_altitude_line_enable" android:summary="@string/summary_altitude_line_enable"
            android:defaultValue="true" />
    

    I have exactly the same thing for EditTextPreference which has the same problem of a max of 2 lines for the summary in Api <= 7

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

Sidebar

Related Questions

I have two classes, CustomerPreferences which extends PreferenceActivity implements OnSharedPreferenceChangeListener and CustomerActivity which extends
I have a PreferenceActivity that loads two Fragments via the xml file for the
I read http://developer.android.com/reference/android/app/Activity.html but I have a question about PreferenceActivity lifecycle: Does a PreferenceActivity
I have the same problem like this question: Custom title bar in PreferenceActivity? After
I have a minimal program that does little more than let me set two
I have an application that uses the new features of honeycomb for the PreferenceActivity.
So my problem is as follows: I have 2 services running in different processes
I have a problem with initializing my app properly after the autostart. I've managed
I have an PreferenceActivity where I would like to add Preferences dynamically. On a
I have used PreferenceActivity to have preference in my android application. I want one

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.