EditText not inizialized

samperizal

Active Member
Licensed User
Longtime User
Greetings.

What should I do to initialize a EditText.
Thank you.

This is the error

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Edit_Text_Servidor As EditText
' Dim EditTextServidor As EditText
Dim Edit_Text_Puerto As EditText
' Dim Edit_Text_Cuenta As EditText
' Dim Edit_Text_Clave As EditText
Dim CheckBox_SSL As CheckBox
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim c As Cursor
Activity.LoadLayout("confcuentacorreo")
Activity.Title = "Configurar la cuenta de correo de salida"
If SQL.IsInitialized Then SQL.Close
' Try

SQL.Initialize(main.DBFilePath, main.DBFileName,False)
str_sql = "Select * from ConfigMail"
c = SQL.ExecQuery(str_sql)
If c.RowCount = 0 Then
Edit_Text_Servidor.Text = "Server" <====Error
 

JesseW

Active Member
Licensed User
Longtime User
If you're going to trap the events from the edittext, I itialize it with the event prefix you wish to use like this:

Edit_Text_Servidor.Initialize("etServidor")

If your not going to use events, initialize it with an empty string like this:

Edit_Text_Servitor.Initialize("")

Documentation is here

Basic4android - Views (Core)
 
Upvote 0

samperizal

Active Member
Licensed User
Longtime User
Greetings.

I initialize the component and the update does nothing.

Edit_text_servidor.text = "test"

thanks
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
What do you have in your layout file ?
In your Dims you have
Dim Edit_Text_Servidor As EditText and
' Dim EditTextServidor As EditText
which one is the correct one ?
Assuming that Edit_Text_Servidor is the correct one.
If you have a view called Edit_Text_Servidor in the layout file you must not initialize it.
If you don't have Edit_Text_Servidor in the layout file you must initialize it and add it to the activity or a panel.
It would be much more efficient if you post your project as a zip file (In the IDE menu File/Export As zip).
In most cases the error is not where you think it is.

Best regards.
 
Upvote 0

samperizal

Active Member
Licensed User
Longtime User
Greetings.

Apparently the file screen was damaged. Delete it and did it again. It worked perfectly.

thanks
 
Upvote 0
Top