go to not working as expected on Android

Michael Doub mikedoub at gmail.com
Sun Apr 13 17:33:19 EDT 2014


I am observing some strangeness that maybe someone has an explanation for.

I have main stack with several substacks in it.   I am using a MobGUI carousel to select the correct substack to go to.  That part works just fine but I can get the substacks to close.

I am working on Android and have a back key and menu handler in the stack script of the main stack.

on backKey
   if the short name of this stack is "CB" then
      quit
   else
      go to card "Main" of stack "CB"
   end if
end backKey

on menukey
   answer "Menu"
   go to card "Main" of stack "CB"
end menu key

this works perfectly in the IDE when I simulate a backkey message.  The calling stack is removed from view and you see the carousel as expected.   When you run it on an android device, the screen seems stuck.  Hitting the back and menu keys seem to have no effect.   I added a button to each sub stack that is:

on mouseup
   backkey
end mouseup

This successfully got be back to the main stack and carousel with the carousel visible but another images are missing.   When you select all of the items in the carousel and use the button to get back.  All of a sudden things start working as you would expect in the first place.   It is almost like, each of the substacks needs to be initialized and loaded into memory.

This is the first time that I have tried to use substacks to partition my functionality where the stack has a user interface, I normally use cards and substacks only for library code.   Am I missing some nuance of initialization of substacks?

I cut all of the functionality out of the application, so I can share it if anyone is interested.

Thanks,
    Mike






More information about the use-livecode mailing list