Page 1 of 1

Go back to current cd after double-click on home btn

Posted: Mon Apr 04, 2016 10:35 am
by jmburnod
Hi All,
When I double-clic on home btn of iPad, the current cd of my App appear among as other app but if I open an other app I see only the first cd of my app. (LC 7.06, iOS 8.4)
I don't know what I miss
Thanks in advance for your light.
Best regards
Jean-Marc

Re: Go back to current cd after double-click on home btn

Posted: Mon Apr 04, 2016 5:11 pm
by quailcreek
Hi Jean-Marc,
Are you saying that if you open your mobile app from the background it opens on the first card of the stack? If so, are you saving the state of your app when it shuts down?

This is a very simple example but you can expand on it as needed.
http://lessons.livecode.com/m/4069/l/15 ... ile-device

Re: Go back to current cd after double-click on home btn

Posted: Mon Apr 04, 2016 5:53 pm
by jmburnod
Hi Tom,
Thanks
Sorry. My explanation was bad.
When I double-click home btn of the iPad. I see the current cd among others app in gallery (?).
If I click the preview of the current cd it open it
But
If I open an other app and come back to gallery then splash screen (not the first cd as I said in my first post) appear instead the current cd.
Best regards
Jean-Marc

Re: Go back to current cd after double-click on home btn

Posted: Mon Apr 04, 2016 8:05 pm
by Dixie
This should always take you back to the last card you visited in the stack...

Code: Select all

on preOpenStack
   if environment() = "mobile" then
      put specialfolderpath("documents") & "/lastplace" into thefile
      if there is not a file thefile then
         put empty into URL ("file:" & thefile)
      else
         put URL ("file:" & thefile) into thelastPlace
         go card id theLastPlace
      end if
   end if
end preOpenStack

on openCard
   if environment() = "mobile" then
      put specialfolderpath("documents") & "/lastplace" into thefile
      put the short id of this card into URL ("file:" & thefile)
   end if
end openCard

Re: Go back to current cd after double-click on home btn

Posted: Tue Apr 05, 2016 9:44 am
by jmburnod
Hi John,
Thanks for your post.
Yes we can do that but I don't understand why splash screen appear instead the current cd when I open an other app.
I thougt we can open the current cd directly without pre and openstack.
Best regards
Jean-Marc