A anaylor01 Well-Known Member Licensed User Longtime User Jun 5, 2011 #1 I have a button when clicked it checks to make sure there is text in the edittext box. But I get an error saying the edittext box needs to be initialized. Can someone give me of an example of how to do this?
I have a button when clicked it checks to make sure there is text in the edittext box. But I get an error saying the edittext box needs to be initialized. Can someone give me of an example of how to do this?
K kickaha Well-Known Member Licensed User Longtime User Jun 5, 2011 #2 Come on mate, not enough info. 1) Did you add the EditBox using the designer or programatically 2) How are you checking its contents 3) What does the error ACTUALLY say 4) As said on numerous occasions, post some code that demonstrates the error. Upvote 0
Come on mate, not enough info. 1) Did you add the EditBox using the designer or programatically 2) How are you checking its contents 3) What does the error ACTUALLY say 4) As said on numerous occasions, post some code that demonstrates the error.
A anaylor01 Well-Known Member Licensed User Longtime User Jun 5, 2011 #3 Sorry. They were added through the designer. The error: An error has occurred in sub: Main_btnsend_click (B4A line: 52) If etareacode.text.length > 0 and etprefix.text.length = 0 then java.lang.runtimeexception:Object should first be initialized(EditText). Code below: Code: Copy If lblfilename.Text.Length = 0 Then If etareacode.Text.Length > 0 AND etprefix.Text.Length = 0 Then Msgbox("Please enter a Prefix in the box.","Missing Prefix") End If Upvote 0
Sorry. They were added through the designer. The error: An error has occurred in sub: Main_btnsend_click (B4A line: 52) If etareacode.text.length > 0 and etprefix.text.length = 0 then java.lang.runtimeexception:Object should first be initialized(EditText). Code below: Code: Copy If lblfilename.Text.Length = 0 Then If etareacode.Text.Length > 0 AND etprefix.Text.Length = 0 Then Msgbox("Please enter a Prefix in the box.","Missing Prefix") End If
K kickaha Well-Known Member Licensed User Longtime User Jun 6, 2011 #4 Please check that the EditText views are: 1) In the layout that is loaded (check the names are the same) 2) There is a Dim statement for it/them in Sub Globals (again check the names carefully) The only way I can see this error is if I Dim an EditText that has not been added via a designer layout. Upvote 0
Please check that the EditText views are: 1) In the layout that is loaded (check the names are the same) 2) There is a Dim statement for it/them in Sub Globals (again check the names carefully) The only way I can see this error is if I Dim an EditText that has not been added via a designer layout.
A anaylor01 Well-Known Member Licensed User Longtime User Jun 6, 2011 #5 That was it. I added it through the designer but changed the DIM name in the code. Upvote 0
K kickaha Well-Known Member Licensed User Longtime User Jun 6, 2011 #6 anaylor01 said: That was it. I added it through the designer but changed the DIM name in the code. Click to expand... I thank you for posting the answer, as this may help others reading the thread. Upvote 0
anaylor01 said: That was it. I added it through the designer but changed the DIM name in the code. Click to expand... I thank you for posting the answer, as this may help others reading the thread.