Build. Hack. Play. It's just what we do.
Build. Hack. Play. It's just what we do.

Extending Home Screen Shortcuts in Android with Tasker

Here's a way to get added functionality from your Android home screen shortcuts with Tasker - launch two apps from one icon by single or double clicking. I had a specific case I wanted this to happen but this method can be extended to almost any two actions. In my case I had a shortcut to open the browser; sometimes I wanted to go to my home page, sometimes I wanted to open where I left off. This needed two shortcuts.

Using Tasker you can accomplish this with one shortcut. Create the following task in Tasker - I called mine Internet for somewhat dubious reasons.


Start Tasker and add a new task like this -

If: %Tapped~0

Variable Set: %Tapped to 1

Wait: 250ms

Variable Set: %Tapped to 0

Load App: Internet (or your browser of choice)


Variable Set: %Tapped to 0

Browse URL:

End If:

Now click the settings icon and set collision handling to Abort Existing Task. Choose an icon for your shortcut from Tasker's icon options. Now add a shortcut to your homescreen - methods vary with your launcher - and point it at 'Task Shortcut' in the list of available options. Select your newly created task - Internet in my case, the Tasker Task screen shows, back out. Now, single clicking the new icon on your home screen opens the action in the 'If' section, double tapping opens the action in the 'Else' section.


All this task does when invoked by one tap is wait a quarter-second to see if you tap the icon again using the variable %Tapped as a flag. The routine always enters first time round with the variable %Tapped == 0. If you tap only once it sets the flag to 1 (icon has been tapped once) and waits 250ms to see if you tap again. If not it resets the flag to 0 for next time around and launches the browser. If, within the quarter-second (you can change this value to suit your finger speed) you tap again then the first iteration is aborted and the task is restarted. This time you're entering the routine with %Tapped==1 and the 'Else' part of the task fires. Again the variable %Trapped is set to 0 for next time round.


Share This Story

Get our newsletter