Return to app from external content
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Return to app from external content
If I launch external content from my app, such as opening a pdf file with Adobe reader, when I close the external content and exit the (for example) reader app, I am returned to the homepage for my device, rather than my app where it was suspended. Selecting my app again restarts it from scratch. Other apps with similar features will return to the suspended calling app. Is it possible to set my app up the same?
Re: Return to app from external content
Hi SparkOut,
I would simply write out a text file with the name or number of th last visited card before you "call" e.g. the PDF viewer
then check, when the stack opens, if that file is present, read it in and go to that card.
OK, this is a simplified explanation, but you get the picture.
Best
Klaus
yep, why not, if you script it!?SparkOut wrote:Other apps with similar features will return to the suspended calling app. Is it possible to set my app up the same?
I would simply write out a text file with the name or number of th last visited card before you "call" e.g. the PDF viewer
then check, when the stack opens, if that file is present, read it in and go to that card.
OK, this is a simplified explanation, but you get the picture.
Best
Klaus
Re: Return to app from external content
Danke Klausimausi,
I know and use this technique for restart of apps between runs. What I was looking for is for the device to switch back to my app after pressing the back key to close external content ( like other apps do). Why does my application actually close when I launch a document?
I know and use this technique for restart of apps between runs. What I was looking for is for the device to switch back to my app after pressing the back key to close external content ( like other apps do). Why does my application actually close when I launch a document?
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
Re: Return to app from external content
On all of my devices when I launch PDF reader it pauses the app and returns to the app last point might be your firmware as i've written a app that uses PDF reader the google one and adobe one and both return to the app when the back button is pressed.
Are you using the launch URL method to open the PDF ?
Are you using the launch URL method to open the PDF ?
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Return to app from external content
I believe this is all handled by the Android OS. Android will automatically go back through previous apps as long as they are still in RAM. But if the app you've launched needs more memory, Android will close down previously-opened apps to free up space, and when that happens you are returned to the launcher.
Is your PDF large? Or maybe Adobe Reader needs a lot of RAM all by itself?
Is your PDF large? Or maybe Adobe Reader needs a lot of RAM all by itself?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Return to app from external content
Yes, I am using launch URL to open PDF. Also it is happening when composing email, after sending it exits to the device homepage, not back to the app. Memory/too many open apps is not a factor, I believe.
It has just occurred to me this app is using a splashtack to launch the runtime stack, and then closes the launcher. Would this be a problem through not handling relaunch?
It has just occurred to me this app is using a splashtack to launch the runtime stack, and then closes the launcher. Would this be a problem through not handling relaunch?
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
Re: Return to app from external content
To be honest not sure but I have tested my app which uses PDF reader on lots of devices and they all return to the app after the PDF reader closes.
So I would try it on a different device as sounds like it's a problem unique to that device.
So I would try it on a different device as sounds like it's a problem unique to that device.
Re: Return to app from external content
Well I couldn't claim an exhaustive test, but three completely different devices ,(tablet, phablet and phone) all have the same issue.
Re: Return to app from external content
Hey, hey, hey, guard your tongue, bold stranger!SparkOut wrote:Danke Klausimausi
Re: Return to app from external content
But But But... I can't say "Klaus" without finishing "...imausi" - I just can't turn it off in my head.
Anyway, I can confirm, if I compile the runtime stack as the .apk to install, that will open external content, and when closing the external content, the app will resume. In the splashstack + runtime stack scenario, closing external content dumps me back to the device homepage, even if the launcher stack wasn't explicitly closed when opening the runtime.
I've played with the relaunch handler but it doesn't seem to have any bearing - the app is actually closed when the runtime stack calls the external content. Or so it seems. Any ideas how to deal with this? I'd really rather not rework the whole structure to avoid the splashstack/runtime scenario.
Anyway, I can confirm, if I compile the runtime stack as the .apk to install, that will open external content, and when closing the external content, the app will resume. In the splashstack + runtime stack scenario, closing external content dumps me back to the device homepage, even if the launcher stack wasn't explicitly closed when opening the runtime.
I've played with the relaunch handler but it doesn't seem to have any bearing - the app is actually closed when the runtime stack calls the external content. Or so it seems. Any ideas how to deal with this? I'd really rather not rework the whole structure to avoid the splashstack/runtime scenario.
Re: Return to app from external content
SparkOut wrote:But But But... I can't say "Klaus" without finishing "...imausi" - I just can't turn it off in my head.
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Return to app from external content
Do you close the splash stack or just hide it? I'm just guessing, but maybe it has to be open to resume.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Return to app from external content
I started out by closing the splashstack, but tried without closing for this reason. Either way, hitting the back button from the external content goes back to the device screen, not my app. Perplexing
Re: Return to app from external content
Do you use custom URL method to launch other apps from your app?
To launch a PDF viewer try also:
To launch a PDF viewer try also:
Code: Select all
launch url "file:///storage/sdcard0/Download/file.pdf"
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Return to app from external content
I'm using the launch url ("file:" & filepath) type method, with the filepath being of /mnt/sdcard/myfolder/myfile.pdf type. It works fine to open the reader.
If I use mobileComposeHtmlMail the email is generated too.
It's just when the pdf reader is closed, or the email is sent and the email app exits, I am returned to the home screen, with my app closed. This happens if I use the splashstack technique to launch a runtime stack which I can save. If I compile the app as a standalone without the splashstack to call it, it opens external content (in email, or pdf reader) and returns to the app at the point where the external app was called. With the splashstack, even if the original launcher app is left open, returning from external content dumps me out of the calling app.
If I use mobileComposeHtmlMail the email is generated too.
It's just when the pdf reader is closed, or the email is sent and the email app exits, I am returned to the home screen, with my app closed. This happens if I use the splashstack technique to launch a runtime stack which I can save. If I compile the app as a standalone without the splashstack to call it, it opens external content (in email, or pdf reader) and returns to the app at the point where the external app was called. With the splashstack, even if the original launcher app is left open, returning from external content dumps me out of the calling app.