Skip to main content

AndroidIntents

Kindclass
Packageandroid.platform
Full nameandroid.platform.AndroidIntents
Sourcesource/android/platform/AndroidIntents.hx

Common Android intents: opening URLs, files and Settings pages, and sharing content through the native share sheet.

Public fields​

NameTypeStaticDefaultNotes
onDeepLinkFlxTypedSignal<String->Void>yes—property (get, never) · Incoming phoenix:// deep links (also fired for the cold-start intent).

Public methods​

static function subscribeDeepLink(listener:String->Void):Void

Subscribes to incoming deep links. Prefer this over adding directly to onDeepLink: it registers the subscription with the delivery tracker so a buffered cold-start deep link is delivered to you as soon as it becomes available.

ParameterTypeDefault
listenerString->Void—

View source

openUrl​

static function openUrl(url:String):Void

Opens a URL in the system browser.

ParameterTypeDefault
urlString—

View source

openSettings​

static function openSettings(?action:String):Void

Opens a Settings page. Pass either a full action ("android.settings.APPLICATION_DETAILS_SETTINGS") or a short name ("WIFI_SETTINGS"); empty opens the main Settings screen.

ParameterTypeDefault
action (optional)String—

View source

openFile​

static function openFile(path:String):Void

Opens a local file with whatever app handles its type.

ParameterTypeDefault
pathString—

View source

shareFile​

static function shareFile(path:String, ?mime:String, ?title:String):Void

Shares a local file through Android's share sheet.

ParameterTypeDefault
pathString—
mime (optional)String—
title (optional)String—

View source

shareText​

static function shareText(text:String, ?title:String):Void

Shares text through Android's share sheet.

ParameterTypeDefault
textString—
title (optional)String—

View source

viewContentUri​

static function viewContentUri(uri:String, ?mime:String):Void

Opens a content:// URI with an external app.

ParameterTypeDefault
uriString—
mime (optional)String—

View source

Internals​

Private / internal members
FieldTypeStatic
_openUrlDynamicyes
_openSettingsDynamicyes
_openFileDynamicyes
_shareFileDynamicyes
_shareTextDynamicyes
_viewContentUriDynamicyes
Method
static inline function get_onDeepLink():FlxTypedSignal<String->Void>
static function openUrl_jni(url:String):Void
static function openSettings_jni(action:String):Void
static function openFile_jni(path:String):Void
static function shareFile_jni(path:String, mime:String, title:String):Void
static function shareText_jni(text:String, title:String):Void
static function viewContentUri_jni(uri:String, mime:String):Void