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

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

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

Post by jmburnod » Mon Apr 04, 2016 10:35 am

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
https://alternatic.ch

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

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

Post by quailcreek » Mon Apr 04, 2016 5:11 pm

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
Tom
MacBook Pro OS Mojave 10.14

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

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

Post by jmburnod » Mon Apr 04, 2016 5:53 pm

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
https://alternatic.ch

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

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

Post by Dixie » Mon Apr 04, 2016 8:05 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

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

Post by jmburnod » Tue Apr 05, 2016 9:44 am

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
https://alternatic.ch

Post Reply