Struct 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>

Source

pub fn from_object(env: JNIEnv<'env>, object: JObject<'env>) -> Self

Source

pub fn new(env: JNIEnv<'env>, action: impl AsRef<str>) -> Self

Source

pub fn new_with_uri( env: JNIEnv<'env>, action: impl AsRef<str>, uri: impl AsRef<str>, ) -> Self

Source

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!")
Source

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();
Source

pub fn into_chooser_with_title(self, title: Option<impl AsRef<str>>) -> Self

Source

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");
Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'a, T> Desc<'a, T> for T

Source§

fn lookup(self, _: &JNIEnv<'a>) -> Result<T, Error>

Look up the concrete type from the JVM.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.