Struct android_intent::Intent
source · pub struct Intent<'env> { /* private fields */ }
Expand description
A messaging object you can use to request an action from another android app component.
Implementations§
source§impl<'env> Intent<'env>
impl<'env> Intent<'env>
pub fn from_object(env: JNIEnv<'env>, object: JObject<'env>) -> Self
pub fn new(env: JNIEnv<'env>, action: impl AsRef<str>) -> Self
pub fn new_with_uri( env: JNIEnv<'env>, action: impl AsRef<str>, uri: impl AsRef<str> ) -> Self
sourcepub fn with_extra(self, key: impl AsRef<str>, value: impl AsRef<str>) -> Self
pub fn with_extra(self, key: impl AsRef<str>, value: impl AsRef<str>) -> Self
Add extended data to the intent.
use android_intent::{Action, Extra, Intent};
let intent = Intent::new(env, Action::Send);
intent.push_extra(Extra::Text, "Hello World!")
sourcepub fn into_chooser(self) -> Self
pub fn into_chooser(self) -> Self
Builds a new Action::Chooser
Intent that wraps the given target intent.
use android_intent::{Action, Intent};
let intent = Intent::new(env, Action::Send).into_chhoser();
pub fn into_chooser_with_title(self, title: Option<impl AsRef<str>>) -> Self
sourcepub fn with_type(self, type_name: impl AsRef<str>) -> Self
pub fn with_type(self, type_name: impl AsRef<str>) -> Self
Set an explicit MIME data type.
use android_intent::{Action, Intent};
let intent = Intent::new(env, Action::Send);
intent.set_type("text/plain");