Struct android_intent::Intent
source · pub struct Intent<'env> {
pub env: JNIEnv<'env>,
pub object: JObject<'env>,
}
Expand description
A messaging object you can use to request an action from another android app component.
Fields§
§env: JNIEnv<'env>
§object: JObject<'env>
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 push_extra(&self, key: impl AsRef<str>, value: impl AsRef<str>)
pub fn push_extra(&self, key: impl AsRef<str>, value: impl AsRef<str>)
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!")
pub fn with_extra(&self, key: impl AsRef<str>, value: impl AsRef<str>) -> &Self
sourcepub fn create_chooser(&self) -> Self
pub fn create_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);
let chooser_intent = intent.create_chooser();
pub fn create_chooser_with_title(&self, title: Option<impl AsRef<str>>) -> Self
sourcepub fn set_type(&self, type_name: impl AsRef<str>)
pub fn set_type(&self, type_name: impl AsRef<str>)
Set an explicit MIME data type.
use android_intent::{Action, Intent};
let intent = Intent::new(env, Action::Send);
intent.set_type("text/plain");