Is there a way to set the app I want a Lauch App action to open from a variable?
I can only see how you manually set a Launch App in the designer, not at run time.
e.g. Set a variable vApp = “Whatsapp”, and the touch action’s Launch App uses that variable to determine it should launch Whatsapp.
Might be answering my own question.
I’ve not tried this yet, but Google says:
Steps to Set a Dynamic Launch App Value
-
Create a Global Variable:
-
Open the KLWP editor and navigate to the Globals tab.
-
Add a new text global variable (e.g., name it appName).
-
Set its value to the package name of the app you want to launch (e.g., com.android.chrome for Google Chrome).
-
Add a Touch Action to an Object:
-
Go back to the Items tab and select the element (shape, image, text, etc.) you want to make interactive.
-
Navigate to the Touch tab for that item.
-
Tap the + icon to add a new action.
-
Select Launch App from the list of actions.
-
Use the Global Variable:
-
Instead of picking an app directly from the list, you will need to enter the package name using a Kustom formula.
-
Tap the calculator icon or the globe icon (depending on the specific version) in the selection screen to enter the formula editor.
-
Enter the formula: $gv(appName)$ (replace appName with the actual name of your global variable).