• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps IndexOutOfBoundsException when moving through EditBoxess

I have 6 EditBoxes (2 columns and 3 rows), when I click on one of them and move through them with the track ball, it focuses on the correct one appropriately; but when I keep moving down, past the last row, it gives me that exception. How do I tell it, when it's focused at the bottom and the trackball is moved downwards, don't try to focus on anything below (since there isn't anything below it)
 
There really isn't any code... it has to do with my layout. I know this because I started a new application (basically the Hello, Android app) and put my layout with nothing implemented and it still crashes.

The exception.

Thread [<3> main] (Suspended (exception IndexOutOfBoundsException))
ViewRoot.draw(boolean) line: 1356
ViewRoot.performTraversals() line: 1097
ViewRoot.handleMessage(Message) line: 1613
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4203
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 791
ZygoteInit.main(String[]) line: 549
NativeStart.main(String[]) line: not available [native method]
 
Upvote 0
Code:
<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
	xmlns:android="http://schemas.android.com/apk/res/android" 
	android:layout_width="fill_parent" 
	android:layout_height="fill_parent">
	
	<RelativeLayout
		android:layout_width="fill_parent" 
		android:layout_height="wrap_content">
	   	<ImageView
	   		android:id="@+id/background"
	   		android:layout_width="wrap_content"
	   		android:layout_height="wrap_content"
	   		android:scaleType="fitXY"
	   		android:src="@drawable/back_v" />
	   	<ImageView
	   		android:id="@+id/image"
	   		android:paddingTop="25px"
	   		android:layout_width="fill_parent"
	   		android:layout_height="wrap_content"
	   		android:src="@drawable/right" />
		<RelativeLayout
			android:layout_width="fill_parent" 
			android:layout_height="wrap_content"
			android:gravity="right"
			android:paddingRight="2px"
			android:paddingTop="5px">
			<Button
				android:id="@+id/how"
				android:text="Show The Work!"
				android:enabled="false"
				android:layout_width="wrap_content"
		        android:layout_height="wrap_content" />
		</RelativeLayout>
	</RelativeLayout>
   		
	<LinearLayout
		android:layout_width="fill_parent" 
		android:layout_height="wrap_content"
		android:orientation="vertical"
		android:paddingTop="220px"
		android:paddingRight="4px"
		android:paddingLeft="5px" >
		<LinearLayout
			android:layout_width="fill_parent" 
			android:layout_height="wrap_content"
			android:orientation="horizontal">
			<LinearLayout
				android:layout_width="wrap_content" 
				android:layout_height="wrap_content"
				android:orientation="horizontal" >
				<TextView 
					android:id="@+id/lblRounding"
					android:textColor="#000000"
					android:layout_width="wrap_content" 
					android:layout_height="wrap_content"
					android:text="Length " />
				<TextView 
					android:id="@+id/rounding"
					android:textColor="#000000"
					android:layout_width="wrap_content" 
					android:layout_height="wrap_content"
					android:text="()" />
			</LinearLayout>
			<LinearLayout
				android:layout_width="fill_parent" 
				android:layout_height="wrap_content"
				android:orientation="horizontal"
				android:gravity="right"
				android:paddingLeft="10px" >
				<TextView 
					android:id="@+id/lblAngleType"
					android:textColor="#000000"
					android:layout_width="wrap_content" 
					android:layout_height="wrap_content"
					android:text="Angle " />
				<TextView 
					android:id="@+id/angleType"
					android:textColor="#000000"
					android:layout_width="wrap_content" 
					android:layout_height="wrap_content"
					android:text="()" />
			</LinearLayout>
		</LinearLayout>
	
		<LinearLayout
			android:layout_width="fill_parent" 
			android:layout_height="wrap_content"
			android:orientation="horizontal"
			android:paddingLeft="5px" >
			<LinearLayout
				android:layout_width="wrap_content" 
				android:layout_height="wrap_content"
				android:orientation="vertical" >
		
			    <TextView android:id="@+id/lbla" 
					android:textColor="#000000"
			              android:text="Side a: "
						  android:layout_width="wrap_content"
			              android:layout_height="wrap_content"
			              android:paddingTop="12px" />
			    <TextView android:id="@+id/lblb" 
					android:textColor="#000000"
			              android:text="Side b: "
						  android:layout_width="wrap_content"
			              android:layout_height="wrap_content"
			              android:paddingTop="29px" />
			    <TextView android:id="@+id/lblc" 
					android:textColor="#000000"
			              android:text="Side c: "
						  android:layout_width="wrap_content"
			              android:layout_height="wrap_content"
			              android:paddingTop="29px" />
			</LinearLayout>
			
			<LinearLayout
				android:layout_width="wrap_content" 
				android:layout_height="wrap_content"
				android:layout_gravity="right"
				android:orientation="vertical" >
		
		    	<EditText 
			    	android:id="@+id/a"
			    	android:width="95px"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content"
			        android:inputType="numberDecimal"
			        android:singleLine="true"
			        android:lines="1"/>
			    <EditText 
			    	android:id="@+id/b"
			    	android:width="95px"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content"
			        android:inputType="numberDecimal"
			        android:singleLine="true"
			        android:lines="1"/>
			    <EditText 
			    	android:id="@+id/c"
			    	android:width="95px"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content"
			        android:inputType="numberDecimal"
			        android:singleLine="true"
			        android:lines="1"/>
			</LinearLayout>
			
			<LinearLayout
				android:layout_width="fill_parent" 
				android:layout_height="wrap_content"
				android:orientation="horizontal"
				android:gravity="right" >
				
				<LinearLayout
					android:layout_width="wrap_content" 
					android:layout_height="wrap_content"
					android:orientation="vertical" >
			
				    <TextView android:id="@+id/lblA" 
					android:textColor="#000000"
				              android:text="Angle A: "
							  android:layout_width="wrap_content"
				              android:layout_height="wrap_content"
				              android:paddingTop="12px" />
				    <TextView android:id="@+id/lblB" 
					android:textColor="#000000"
				              android:text="Angle B: "
							  android:layout_width="wrap_content"
				              android:layout_height="wrap_content"
				              android:paddingTop="29px" />
				    <TextView android:id="@+id/lblC" 
					android:textColor="#000000"
				              android:text="Angle C: "
							  android:layout_width="wrap_content"
				              android:layout_height="wrap_content"
				              android:paddingTop="29px" />
				</LinearLayout>
				
				<LinearLayout
					android:layout_width="wrap_content" 
					android:layout_height="wrap_content"
					android:orientation="vertical">
			
				    <EditText 
				    	android:id="@+id/A"
				    	android:width="95px"
						android:layout_width="wrap_content"
				        android:layout_height="wrap_content"
				        android:inputType="numberDecimal"
				        android:singleLine="true"
				        android:lines="1"/>
				    <EditText 
				    	android:id="@+id/B"
				    	android:width="95px"
						android:layout_width="wrap_content"
				        android:layout_height="wrap_content"
				        android:inputType="numberDecimal"
				        android:singleLine="true"
				        android:lines="1"/>
				    <EditText 
				    	android:id="@+id/C"
				    	android:width="95px"
						android:layout_width="wrap_content"
				        android:layout_height="wrap_content"
				        android:singleLine="true"
				        android:lines="1"
				        android:inputType="numberDecimal"/>
				</LinearLayout>
			</LinearLayout>
		</LinearLayout>	
		
		<LinearLayout
			android:layout_width="fill_parent" 
			android:layout_height="wrap_content"
			android:orientation="horizontal"
			android:paddingLeft="20px" >
			<LinearLayout
				android:layout_width="wrap_content" 
				android:layout_height="wrap_content"
				android:orientation="horizontal" >
				<TextView
					android:textColor="#000000"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content"
			        android:paddingTop="10px"
			        android:text="Area = " />
				<TextView
					android:textColor="#000000"
					android:id="@+id/area"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content"
			        android:paddingTop="10px"
			        android:numeric="decimal"
					android:inputType="none"
			        android:text="0.0" />
				<TextView
					android:textColor="#000000"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content"
			        android:paddingTop="10px"
			        android:text=" Units^2" />
			</LinearLayout>
			<LinearLayout
				android:layout_width="fill_parent" 
				android:layout_height="wrap_content"
				android:orientation="horizontal"
				android:gravity="right"
				android:paddingLeft="10px" >
				<Button
					android:id="@+id/clear"
					android:text="Clear"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content" />
				<Button
					android:id="@+id/calculate"
					android:text="Calculate"
					android:enabled="false"
					android:layout_width="wrap_content"
			        android:layout_height="wrap_content" />
			</LinearLayout>
		</LinearLayout>
	</LinearLayout>
</RelativeLayout>
 
Upvote 0
Actually I think I found something that might be the problem. When running with 2.2 I noticed that when I select the left column and press the down arrow (or scroll down with the track ball), I can "select" the TextView and change the numbers in there. How do I tell the TextView not to be able to take any inputs. I thought it was inputType="none" but apparently that doesn't do it.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones