Ariyan Ahmadpour New Member Licensed User Dec 9, 2016 #1 hey.i want to add 1 to a value when an ativity start for example B4X: dim tst as int tst = 1 Sub Activity_Pause (UserClosed As Boolean) End Sub i want to when Activity_Pause start,tst be + 1 and for next time,+1 too for ever sorry for my bad english
hey.i want to add 1 to a value when an ativity start for example B4X: dim tst as int tst = 1 Sub Activity_Pause (UserClosed As Boolean) End Sub i want to when Activity_Pause start,tst be + 1 and for next time,+1 too for ever sorry for my bad english
KMatle Expert Licensed User Longtime User Dec 10, 2016 #2 You need to store that variable to a file (See the file documentation how to write to a file). In Activity_Pause save "tst" to a file (Pause = App is closed) In Activity_Resume load "tst" from the file (check if the file exits) and add 1 to tst (tst=tst +1) (Resume = App (re)starts) I recommend that you take a look at the beginners guide: https://www.b4x.com/android/forum/threads/b4a-beginners-guide.9578/#content Upvote 0
You need to store that variable to a file (See the file documentation how to write to a file). In Activity_Pause save "tst" to a file (Pause = App is closed) In Activity_Resume load "tst" from the file (check if the file exits) and add 1 to tst (tst=tst +1) (Resume = App (re)starts) I recommend that you take a look at the beginners guide: https://www.b4x.com/android/forum/threads/b4a-beginners-guide.9578/#content