Android XML Fails when EditText after Textview

abz

New Member
I am getting the error \[code\]TextView cannot be cast to EditText.\[/code\]This occurs when I change the order of the XML so that EditText is in the correct (desired) place.It happens on this line:\[code\] EditText edtPassword = (EditText)findViewById(R.id.EditText03);\[/code\]Im baffled because they are not linked in any way.\[code\]<EditText android:id="@+id/EditText03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="160dip" ></EditText><TextView android:id="@+id/TextView03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="UserName:" ></TextView><TextView android:id="@+id/TextView04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Password:"></TextView>// IF I MOVE AN EditText03 Here instead it just crashes.\[/code\]
 
Back
Top