activity firsttime

Cor

Active Member
Licensed User
Longtime User
Why isn't firsttime in activity accesable for other subroutines

Now i have o put firsttime in another var to check if i dont want to execute

e.g. edittext_TextChanged

or are there other solutions, to prevent edttext executing textChanged

grCor
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should not use FirstTime for this.
FirstTime is true only when the process first starts. Your activity can be recreated many times while the process is kept alive.
You will need to use your own variable. Something like:
Sub Globals
Dim DuringInitialize As Boolean
End Sub

Sub Activity_Create (FirstTime As Boolean)
DuringInitialize = true
...
End Sub

Sub Activity_Resume
...
DuringInitialize = false
End Sub
[/code]

This tutorial is relevant: http://www.b4x.com/forum/basic4andr...87-android-process-activities-life-cycle.html
 
Upvote 0
Top