Intents are Android's main method for allowing apps to communicate with each other and share data. Intents are for advanced users. This document is not intended to explain how intents work, but how to use Tasker's intent facilities.
Tasker allows you to send arbitraty intents using the Send Intent action in the Misc category. This allows you to provoke behaviour in other apps, when you know the particular form of intent they are designed to respond to.
Example: android.intent.action.VIEW
Can't be used together with a Data specification.
Can't be used together with a Mime-Type specification.
The extras must be in the form of a single colon-separated key and value.
If the value can be parsed as an integer, long (integer ending in L), floating point number, double (float ending in D) or boolean (true/false) it will be treated as one.
The value can also be forced to a simple type (long etc) or Uri
via casting.
The name of a Java object created via the Java Function action which is of type Parcelable
can also be used (e.g. a Bundle
)
If none of the above apply, the value will be treated as a String
.
Examples:
boolean
)
int
)
int
)
Uri
)
Parcelable
)
String
)
aapt dump xmltree example.apk AndroidManifest.xml
Look for Intent Filter elements.
It's not (easily) possible to determine which intents an app listens for dynamically (i.e. while the app is running).Tasker allows you to receive a large range of intents, sent by apps or the system, using the Intent Received event in the System category.
For each event you create, Tasker sets up a corresponding Intent Filter object.
In addition, any extras attached to the intent can be accessed under their name, with the following modifications to make them valid variable names:
For example, an extra with key %SOUND_ON will be available as %sound_on, and an extra with key package.SOUND_ON!, will be available via the local variable %package_sound_on_a
The following extra types are presented in Tasker as local arrays:
String [], Integer [], ArrayList
.
Example: a string array extra `named 'fruits' with values 'pear' and 'apple' will result in the local variables %fruits1 (=pear) and %fruits2 (=apple).
WikiD Instuctables is a not-for-profit venture by CommWi Projects. CommWi Projects or any person affiliated with, are not in any official way, affiliated, endorsed, sponsored or licensed by any of the software, hardware, companies or persons documented on this site. Please address any Copyright or IP concerns to myself so they may be dealt with appropriately. Content hosted on this site, unless otherwise stated, is provided under the license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).