Hi, I couldn't find any existing reference to this in the forum.
I was trying a "Hello world" test program to allow me to play with the Android emulator. The program has 1 activity, with a just one Label, designed in the visual Designer. In Designer I gave it a default Text, "B4A is great".
My code is:
My problem is that the text in the label is stuck at the design-time default. If I comment out the Label1.Initialize line, the text changes to "Hello World", but of course the Click event handler is lost.
What am I doing wrong? Why is initialising the label preventing its text from being subsequently altered?
(I can't post the project as a zip because B4A has decided it will only use a folder that I have renamed to export a zip file to ... that may require another post!)
David Stonier-Gibson
Samsung Galaxy ACE, 2.3.4
http://splatco.com
I was trying a "Hello world" test program to allow me to play with the Android emulator. The program has 1 activity, with a just one Label, designed in the visual Designer. In Designer I gave it a default Text, "B4A is great".
My code is:
B4X:
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Label1.Initialize("Label1") '<<<<<<<<<<<<<<<<<<<<<<<<
Label1.Text = "Hello world"
Activity.Invalidate
End Sub
Sub Label1_Click
Label1.Text = "Click!"
Activity.Invalidate
End Sub
My problem is that the text in the label is stuck at the design-time default. If I comment out the Label1.Initialize line, the text changes to "Hello World", but of course the Click event handler is lost.
What am I doing wrong? Why is initialising the label preventing its text from being subsequently altered?
(I can't post the project as a zip because B4A has decided it will only use a folder that I have renamed to export a zip file to ... that may require another post!)
David Stonier-Gibson
Samsung Galaxy ACE, 2.3.4
http://splatco.com