Listen for preset loaded events#
Starting from v3.82 Kustom sends a broadcast when a preset finishes loading. This allows external apps like Tasker to react to preset changes.
Broadcast Action#
org.kustom.action.PRESET_LOADED
Extras#
| Extra | Type | Description |
|---|---|---|
org.kustom.extra.SPACE_ID | String | Space URI (e.g. kspace://klwp/0, kspace://kwgt/123) |
org.kustom.extra.PRESET_TITLE | String | Preset title |
org.kustom.extra.EXTERNAL | Boolean | True if loaded via external request (Tasker, shortcut) |
Tasker Example#
- Create a new Profile with Event > Intent Received
- Set Action to
org.kustom.action.PRESET_LOADED - In your Task, use
%space_id,%preset_title, and%externalvariables
Android Code Example#
BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String spaceId = intent.getStringExtra("org.kustom.extra.SPACE_ID");
String title = intent.getStringExtra("org.kustom.extra.PRESET_TITLE");
boolean external = intent.getBooleanExtra("org.kustom.extra.EXTERNAL", false);
}
};
IntentFilter filter = new IntentFilter("org.kustom.action.PRESET_LOADED");
context.registerReceiver(receiver, filter);