Hi all.
I'm desperately looking for help.
I have read the forum and the user guides and I cant see that anyone has encountered this before.
I am a newbie at B4A (but a Whizz at Qbasic and OK at Visual Basic) and am having major problems in controlling / losing program flow control when using user input (buttons), layouts but, more particularly, starting new activities.
Some activities just do not start at all when called (I've even called the activity several times one after the other) or others "start", but pass control back to the next line of the programme after the start request, and then only display the second activity when the rest of the code has run (which makes it pointless as the code needs the user data to continue to the next part).
This happens even if I have used activity.finish to close the previous activity
I have even got one programme which jumps to code in a code module after an activity has been called when the module has definitively not been called.
Sometimes, when the activity starts, it returns to the main module without any user input even when the code is controlled by conditions (not always activity.resume)
A sample code is attached (a much trimmed down version of my programme) just to see if others have the same experience. Basically, on this code, the second activity is only displayed once the rest of the code has completed, despite it being called mid way.
I am using the Google AVD emulator, the latest Android SDK (API 19 and 20 both tried), the latest Java download and the latest version of B4A. I didn't know if this was a problem with my installation so I have installed all on a second computer and getting the same results.
All other programming code flows and works fine - its just when I call layouts (sometimes) or start second activities.
I have tried using callsub delayed. do while ... etc.etc. but to no avail.
Is this normal (intended) programming behaviour or is this a problem?
Or is it something where I have no choice but to code for all of the outcomes via activity.resume (if I don't use activity.finish then often, but not always, the programme goes back to activity.resume)
Thank in advance - really appreciated.
If I'm missing something then always willing to listen
Andy
I'm desperately looking for help.
I have read the forum and the user guides and I cant see that anyone has encountered this before.
I am a newbie at B4A (but a Whizz at Qbasic and OK at Visual Basic) and am having major problems in controlling / losing program flow control when using user input (buttons), layouts but, more particularly, starting new activities.
Some activities just do not start at all when called (I've even called the activity several times one after the other) or others "start", but pass control back to the next line of the programme after the start request, and then only display the second activity when the rest of the code has run (which makes it pointless as the code needs the user data to continue to the next part).
This happens even if I have used activity.finish to close the previous activity
I have even got one programme which jumps to code in a code module after an activity has been called when the module has definitively not been called.
Sometimes, when the activity starts, it returns to the main module without any user input even when the code is controlled by conditions (not always activity.resume)
A sample code is attached (a much trimmed down version of my programme) just to see if others have the same experience. Basically, on this code, the second activity is only displayed once the rest of the code has completed, despite it being called mid way.
I am using the Google AVD emulator, the latest Android SDK (API 19 and 20 both tried), the latest Java download and the latest version of B4A. I didn't know if this was a problem with my installation so I have installed all on a second computer and getting the same results.
All other programming code flows and works fine - its just when I call layouts (sometimes) or start second activities.
I have tried using callsub delayed. do while ... etc.etc. but to no avail.
Is this normal (intended) programming behaviour or is this a problem?
Or is it something where I have no choice but to code for all of the outcomes via activity.resume (if I don't use activity.finish then often, but not always, the programme goes back to activity.resume)
Thank in advance - really appreciated.
If I'm missing something then always willing to listen
Andy