cbanks Active Member Licensed User Longtime User Mar 9, 2012 #1 I'd like to have a user type in an EditText and then when they click a save button I want to save what they typed in the EditText box. I have some code below I'm testing with that doesn't seem to work. in the test I'm just trying to toastmessage what has been typed in the box. Does anyone know what I'm doing wrong? Here is the code: 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim panel1 As Panel Dim Button1 As Button Dim edittext1 As EditText End Sub Sub Activity_Create(FirstTime As Boolean) activity.LoadLayout("asdf") panel1.Visible = True edittext1.Initialize("") End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub button1_click Dim typedin As String typedin = edittext1.text ToastMessageShow(typedin,False) End Sub Last edited: Mar 9, 2012
I'd like to have a user type in an EditText and then when they click a save button I want to save what they typed in the EditText box. I have some code below I'm testing with that doesn't seem to work. in the test I'm just trying to toastmessage what has been typed in the box. Does anyone know what I'm doing wrong? Here is the code: 'Activity module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim panel1 As Panel Dim Button1 As Button Dim edittext1 As EditText End Sub Sub Activity_Create(FirstTime As Boolean) activity.LoadLayout("asdf") panel1.Visible = True edittext1.Initialize("") End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub button1_click Dim typedin As String typedin = edittext1.text ToastMessageShow(typedin,False) End Sub
rfresh Well-Known Member Licensed User Longtime User Mar 9, 2012 #2 Try using a Messagebox to see if you can retrieve the text, it looks like you should be able to. Upvote 0
klaus Expert Licensed User Longtime User Mar 9, 2012 #3 If EditText1 is defined in the Designer you should remove this line: Code: EditText1.Initialize("") Best regards. Upvote 0
If EditText1 is defined in the Designer you should remove this line: Code: EditText1.Initialize("") Best regards.
cbanks Active Member Licensed User Longtime User Mar 9, 2012 #4 Removing the initialize line made it work. Thanks! Upvote 0