how can I open url link in Unity/Vuforia android app
Hello, I have made a Vuforia app for android and everything works perfect, except from a GUI button. I want it to link to my site (I'm using Application.OpenURL), it opens correctly in my browser, but when I go back to my app it automatically restarts... How can I avoid this? Is thre any other C# method to do this? I'm new to scripting, any help would be very much appreciated!
Thank you very much.
Answer by HenryStrattonFW · Nov 06, 2015 at 11:00 AM
This is typically because when your device switches to the web-app it decides for whatever reason that it needs to free up some memory, its common policy on android and iOS that when the devices wants more memory, it will simply terminate some apps running in the background in order to get what it needs. The best way to avoid this is to try and reduce the amount of memory your app takes to run, but beyond that, at the end of the day, this will still occur sometimes on some devices and there isn't really anything you can do to stop it entirely, you can only try to reduce it. If you ensure that all other apps on your device are closed, and only your app is running you may notice it does not occur.
Of course there is also the possibility that your application has a bug when the on resume methods are called that then causes it to crash, but checking the logs through LogCat would be a quick way of checking and or eliminating this possibility.
Answer by peppas · Nov 06, 2015 at 12:03 PM
Thank you Harry for your answer. So, if that's a memory problem I suppose there is nothing else to try - or maybe not? Any other methods for calling a URL through my app?
Thank you very much
If it is what I suggested it could be, then all you can do is try to optimize your app as best you can to reduce its memory foot print, but there is no 100% way to stop it from happening if it is that, as its down to the OS at the end of the day. No OpenURL is about as basic as it gets for opening a url link.
Also try to post things like this as replies ins$$anonymous$$d of an answer :) just keeps things organized on the answers pages.
Your answer
![](https://koobas.hobune.stream/wayback/20220612044109im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Trouble with GUI Button Level switching. 0 Answers
How to create GUI BUTTON from this 1 Answer
Mouse click not registered correctly using CRT shader 0 Answers
Trying to change text of button using script 1 Answer
GUI button not working? 1 Answer