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");
pub fn start_activity(self) -> Result<(), Error>
Auto Trait Implementations§
impl<'env> Freeze for Intent<'env>
impl<'env> RefUnwindSafe for Intent<'env>
impl<'env> !Send for Intent<'env>
impl<'env> !Sync for Intent<'env>
impl<'env> Unpin for Intent<'env>
impl<'env> UnwindSafe for Intent<'env>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more