So I have a calculator program, and everytime I try to test it on the emulator, it gives me an error with the following code
B4X:
Timer1_Tick
Dim price,pounds,results As Float
price = PriceLabel.Text
If PriceButtonDown Then
If PriceButtonPressed ="Increase" Then
price = price + .05
Else
If price>0 Then
price = price - .05
End If
End If
PriceLabel.Text = NumberFormat(price,0,2)
End If
It highlights the price = PriceLabel.Text and says I have to initialize the label. What should I do to correct this?
You hade the initialization and adding of pnlMain in the condition below If StateManager.RestoreState(Activity, "Main", 60) = False Then
When StateManager.RestoreState(Activity, "Main", 60) = True no pnlMain no layout loaded and as the timer is enabled you got the error.
I sent you code here some time ago but you never used it ?