Page 1 of 1
Launch app problem
Posted: 29 Nov 2014 05:34
by viktor
Hello,
I am using an App Task Running condition with a * filter and reading the top_activity variable to store the currently running app for later re-activation. However, when the Launch App action executes with the stored package name I get an error such as:
ch.gridvision.ppam.androidautomagic.util.r: Could not get launch intent for package com.google.android.apps.chrome.ChromeTabbedActivity. Please define a class.
But I cannot define a class since I don't know what app is going to be launched. Is there some way to solve this? Either to get the "default class" to work or if the active class can be supplied as an additional parameter in App Task Running?
Thanks.
Re: Launch app problem
Posted: 29 Nov 2014 13:04
by PaulyQ
http://automagic4android.com/flow.php?i ... 530cec7a82
I have attached a flow which toggles back to previous app (using seperate automagic notification trigger). Hope that helps with your problem.
Re: Launch app problem
Posted: 29 Nov 2014 18:16
by viktor
Hi.
The problem with the way I wanted to do it is that the package_name variable is not available from the App Task Running condition.
Based on your suggestion I reworked my solution to use a separate flow that constantly monitors the currently active task and stores the package name in a global variable. It would have been a bit more elegant to use the App Task Running condition to detect the active app instead of requiring another permanently active flow which puts somewhat more strain on the system, but it's not a problem for my use.
It works fine now and I'm very happy with how this automation turned out (working around a problem with Spotify). So thanks for your help!
I have to say I've been very impressed with Automagic. I started out implementing this idea with Tasker which I had never used before. It would have worked out also, but along the way I stumbled upon Automagic and after some basic experiments I was convinced enough to buy it and abandon Tasker. I have been a programmer all my career so the logical aspects of settings this kind of stuff up is not a problem, but the way Automagic pleases my intuitive side is quite something. The combination of simplicity and power makes it a joy to play around with and brings out my creativity. I think it sets an excellent example and I see similar principles being embraced in much wider areas of software development and digital device interaction in the near future.
There is of course some room for improvement, one of the obvious examples being the dialog for choosing triggers, actions and conditions which could benefit from splitting up all the items into groups and a more visual orientation.
But with the elegance, the versatility and the accessibility (the embedded help system is a godsend) this is a beautiful piece of software. Fantastic job!