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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:45:21+00:00 2026-06-10T05:45:21+00:00

I am trying to fit two CheckBoxes into a single TableRow , so that

  • 0

I am trying to fit two CheckBoxes into a single TableRow, so that they sit side by side. My program crashes at run time as soon as I try to load the view.

I previously had them each in their own row, but want to change them to fitting in the same row. I have messed with the android:layout_width feature but to no avail. This is the code I have for the TableRow.

         <TableRow>
            <CheckBox 
                android:id="@+id/circleCloseCheck"
                android:text="@string/parameters_circle_close"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />

            <CheckBox
                android:id="@+id/nwpCheck"
                android:text="@string/parameters_nwp_check"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
        </TableRow>

This is my LogCat…

08-23 08:59:20.760: W/dalvikvm(27494): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-23 08:59:20.768: E/AndroidRuntime(27494): FATAL EXCEPTION: main
08-23 08:59:20.768: E/AndroidRuntime(27494): java.lang.RuntimeException: Unable to start activity ComponentInfo{my.eti.commander/my.eti.commander.Parameters}: java.lang.ClassCastException: android.widget.CheckBox
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.os.Looper.loop(Looper.java:130)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.ActivityThread.main(ActivityThread.java:3683)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at java.lang.reflect.Method.invokeNative(Native Method)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at java.lang.reflect.Method.invoke(Method.java:507)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at dalvik.system.NativeStart.main(Native Method)
08-23 08:59:20.768: E/AndroidRuntime(27494): Caused by: java.lang.ClassCastException: android.widget.CheckBox
08-23 08:59:20.768: E/AndroidRuntime(27494):    at my.eti.commander.Parameters.populateArrayLists(Parameters.java:534)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at my.eti.commander.Parameters.onCreate(Parameters.java:54)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-23 08:59:20.768: E/AndroidRuntime(27494):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-23 08:59:20.768: E/AndroidRuntime(27494):    ... 11 more

EDIT :

Here is the information for line 534 in my Parameters.java file. Line 534 is wattVarCurrentSpinner = (Spinner) findViewById( R.id.wattVarCurrentSpinner.

    wattVarCurrentRelayList = new ArrayList<String>();
    wattVarCurrentRelayList.add( "N/A" );
    for( int i = 1; i <= 100; i++ ) {
        double temp = (i/10.0);
        wattVarCurrentRelayList.add( String.valueOf( temp ) );
    }
    wattVarCurrentSpinner = (Spinner) findViewById( R.id.wattVarCurrentSpinner );
    if( RelayAPIModel.AppPrefsType.displayUnits.equals( "Relay" ) ) {
        wattVarCurrentAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_spinner_item, wattVarCurrentRelayList );
    } else if( RelayAPIModel.AppPrefsType.displayUnits.equals( "Protector" ) ) {
        wattVarCurrentAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_spinner_item, wattVarCurrentProtectorList );
    } else if( RelayAPIModel.AppPrefsType.displayUnits.equals( "Percent" ) ) {
        wattVarCurrentAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_spinner_item, wattVarCurrentPercentList );      
    } else {
        RelayAPIModel.AppPrefsType.displayUnits = "Relay";
        wattVarCurrentAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_spinner_item, wattVarCurrentRelayList );
    }
    wattVarCurrentAdapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );
    wattVarCurrentSpinner.setAdapter( wattVarCurrentAdapter );
  • 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-10T05:45:23+00:00Added an answer on June 10, 2026 at 5:45 am

    I think you forgot to add layout_width and layout_height for TableRow
    Also need to change the check box layout_width to “wrap_content”

        <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
    
        <CheckBox
            android:id="@+id/circleCloseCheck"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/parameters_circle_close" />
    
        <CheckBox
            android:id="@+id/nwpCheck"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/parameters_nwp_check" />
    </TableRow>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fit a 20x20 table into a view using a programmatically built
I find myself always trying to fit everything into the OOP methodology, when I'm
I'm trying to implement a fairly simple card game in Python so that two
I am trying to make form elements fit into a visual style with other
I am trying to fit two EditText s horizontally. What I am trying to
I am trying to list all accounts that have not been logged into outside
Background I'm trying to figure out how to run a single unittest against multiple
I'm trying to fit the information from the G function of my data to
I have installed rapache and I am trying to fit a linear model inside
Based on earlier thread with same argument i am trying to fit a stable

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.