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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:01:27+00:00 2026-05-23T04:01:27+00:00

i have a boolean[] , checkbox[] , and view[] ( impactsb[] , impactsc[] ,

  • 0

i have a boolean[], checkbox[], and view[] (impactsb[],impactsc[],impactsv[] respectively) that each have a length of 8. i know that that the first position is 0, the next is 1, etc and that the last position is 7. for some reason, my app crashes when you try to do anything with the last position, in other words, 0-6 work fine, 7 never has. what am i doing wrong?

here is my code for this class, which is its own activity an part of a main activity as a tab. sorry about the sloppy formatting.

package com.citsci.mardeb;

... imports ....

public class Impacts extends Activity implements View.OnClickListener
    {
    static boolean[] impactsb = new boolean[] {false, false, false, false, false, false, false, false};

@Override
public void onCreate (Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);     
    setContentView(R.layout.impacts);

  View[] impactsv = new View[]
     {
    findViewById(R.id.gas_oil),
        findViewById(R.id.ghost_fishing),
        findViewById(R.id.marsh_damage),
        findViewById(R.id.nav_haz),
        findViewById(R.id.shell_damage),
        findViewById(R.id.waste_pollution),
        findViewById(R.id.wild_entang),
        findViewById(R.id.other)
        };

  CheckBox[] impactsc = new CheckBox[impactsv.length];

  for (int i = 0; i < 8; i++)
     {
     impactsc[i] = (CheckBox) impactsv[i];
     impactsc[i].setTag(i);
     impactsc[i].setOnClickListener(this);
     }

}// end of onCreate

@Override
public void onClick(View v)
    {
  switch ((Integer)v.getTag())
    {
     case (0):
        impactsb[0] =! impactsb[0];
        break;
     case (1):
        impactsb[1] =! impactsb[1];
        break;
     case (2):
        impactsb[2] =! impactsb[2];
        break;
     case (3):
        impactsb[3] =! impactsb[3];
        break;
     case (4):
        impactsb[4] =! impactsb[4];
        break;
     case (5):
        impactsb[5] =! impactsb[5];
        break;
     case (6):
        impactsb[6] =! impactsb[6];
        break;
     case (7):
        impactsb[7] =! impactsb[7];
        EditText view = (EditText) findViewById(R.id.other);
        if (view.getVisibility() == View.INVISIBLE)
                view.setVisibility(View.VISIBLE);
        else
            view.setVisibility(View.INVISIBLE);
        break;
        }
    }
}// end of Impacts.class

error codes:

ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1768    
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1784 
ActivityThread.access$1500(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 123   
ActivityThread$H.handleMessage(Message) line: 939

this is related to this previous question and this other previous question

  • 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-23T04:01:28+00:00Added an answer on May 23, 2026 at 4:01 am

    Your problems is not indexes or array lengths.
    The issue is that you have a TextView called “other” and a CheckBox named “other” and findViewById doesn’t know which one to grab when you call it.
    Change the TextView id it “other_text” and your problems will be solved.

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

Sidebar

Related Questions

I have a DataTable that has a boolean column called [Invalid]. I need to
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but
I have a database column WantsReply that logically holds a boolean (bit) but is
I have a dataset that is essentially a list of objects with a boolean
I have a UI that can either use a checkbox or a pair of
Why isn't Collection.remove(Object o) generic? Seems like Collection<E> could have boolean remove(E o); Then,
I have a boolean variable declared at the top of a class and when
The case goes as following: You have a Boolean property called FullScreenEnabled. You enter
Since MySQL doesn't seem to have any 'boolean' data type, which data type do
I have a class isSearching with a single boolean property in a 'functions' file

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.