Sub Activity_Pause (UserClosed As Boolean)
Main.PageNumber= PageTurner.CurrentPage
Main.CatNum=CatNum
PageTurner.OnPause
End Sub
Sub Activity_Resume
Log (Main.PageNumber)
Log(Main.CatNum)
PageNumber=Main.PageNumber
CatNum=Main.CatNum
PageTurner.CurrentPage = PageNumber
PageTurner.OnResume
End Sub
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL As SQL
Dim PageNumber,CatNum As Int
Dim ProgressBar1 As ProgressBar
Dim TotalDownloaded,TotalSize As Long
End Sub
Just so we are clear on the events:
1) In the main module you are setting PageNumber and CatNum to values.
2) When you call the secondary activity the values are zero
If the above is correct I would check what the values are just before the secondary activity is called (which you appear to have done), and also examine the main activities pause event to see if that is resetting the values.
Sub Activity_Resume
Log(PageNumber)
End Sub
How are you calling the second activity, and do you close the main activity after you have called the second one?
Sub Activity_Create(FirstTime As Boolean)
If FirstTime=True Then
Log ("Yes")
....
end sub
This log is indeed strange. Can you clear the log, run your program and post the log?** Activity (catalogues) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
'Activity module
Sub Process_Globals
Dim PageNumber,CatNum As Int
End Sub
Sub Globals
Dim btnTest As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
btnTest.Initialize ("new")
If FirstTime Then
PageNumber=0
CatNum=0
btnTest.Text = "Second Activity"
Activity.AddView (btnTest,0,0,200,200)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub new_Click
Log ("PageNumber = "&PageNumber)
Log ("CatNum = "&CatNum)
StartActivity (Increment)
End Sub
Sub Process_Globals
End Sub
Sub Globals
Dim PageNumber,CatNum As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim btnExit As Button
btnExit.Initialize ("exit")
btnExit.Text = "Exit and increment"
Activity.AddView (btnExit,0,0,200,200)
End Sub
Sub Activity_Resume
PageNumber = main.PageNumber
CatNum = main.CatNum
Log ("Main.PageNumber = "&Main.PageNumber)
Log ("Main.CatNum = "& Main.CatNum)
CatNum= CatNum+1
PageNumber=PageNumber+1
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Main.PageNumber = PageNumber
Main.CatNum = CatNum
Log ("Main.PageNumber = "&Main.PageNumber)
Log ("Main.CatNum = "& Main.CatNum)
End Sub
Sub exit_Click
Activity.Finish
End Sub
When you click the buttons, you should see PageNumber and CatNum being incremented in the logs.
Well that works ok. So i guess it must be cos i am pressing the home button. I will put a menu item in to exit the second activity and see if that fixes the problem
1/70 /cats/baby/BABY 124.jpg
2/70 /cats/baby/BABY 140.jpg
3/70 /cats/baby/BABY 168.jpg
** Activity (catalogues) Pause, UserClosed = true **
Main.PageNumber = 3
Main.CatNum = 0
** Activity (main) Create, isFirst = true **
Yes
** Activity (main) Resume **
0
Sub Activity_Create(FirstTime As Boolean)
If FirstTime=True Then
Log ("Yes")
etc
end sub
Sub mnuExit_Click
Activity.Finish
End Sub
How are you calling the second activity, and do you close the main activity after you have called the second one?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?