[][src]Struct android_ndk::native_activity::NativeActivity

pub struct NativeActivity { /* fields omitted */ }

An ANativeActivity *

This is either provided in ANativeActivity_onCreate, or accessible in android_native_app_glue's android_app.

Methods

impl NativeActivity[src]

pub unsafe fn from_ptr(ptr: NonNull<ANativeActivity>) -> Self[src]

Create a NativeActivity from a pointer

By calling this function, you assert that it is a valid pointer to a native ANativeActivity.

pub fn ptr(&self) -> NonNull<ANativeActivity>[src]

The pointer to the native ANativeActivity

impl NativeActivity[src]

Methods that relate to fields of the struct itself

The relevant NDK docs can be found here.

pub fn sdk_version(&self) -> i32[src]

The platform's SDK version code

pub fn internal_data_path(&self) -> &CStr[src]

Path to this application's internal data directory

pub fn external_data_path(&self) -> &CStr[src]

Path to this application's external (removable, mountable) data directory

pub fn asset_manager(&self) -> AssetManager[src]

This app's asset manager, which can be used to access assets from the .apk file.

pub fn instance(&self) -> *mut c_void[src]

Instance data associated with the activity

pub fn instance_mut(&mut self) -> &mut *mut c_void[src]

Instance data associated with the activity

pub fn vm(&self) -> JavaVM[src]

This processe's JavaVM object.

let vm = native_activity.vm();
let env = vm.attach_current_thread();
// Do JNI with env ...

pub fn activity(&self) -> JObject[src]

The android.app.NativeActivity instance

In the JNI, this is named clazz; however, as the docs say, "it should really be named 'activity' instead of 'clazz', since it's a reference to the NativeActivity instance.

pub unsafe fn obb_path(&self) -> &CStr[src]

Path to the directory with the application's OBB files.

Only available as of Honeycomb (Android 3.0+, API level 11+)

impl NativeActivity[src]

Methods that relate to ANativeActivity_* functions.

The relevant NDK docs can be found here.

pub fn finish(&self)[src]

Sends a destroy event to the activity and stops it.

pub fn show_soft_input(&self, force: bool)[src]

Shows the IME (the on-screen keyboard).

If force is true, the SHOW_FORCED flag is used; otherwise, the SHOW_IMPLICIT flag is used. Depending on the value of this flag, the hide_soft_input method with behave differently. See the relevant javadoc for more information.

pub fn hide_soft_input(&self, not_always: bool)[src]

Hides the IME (the on-screen keyboard).

If not_always is true, the HIDE_NOT_ALWAYS flag is used; otherwise, the HIDE_IMPLICIT_ONLY flag is used. Depending on the value of this flag and the way the IME was shown, it may or may not be hidden. See the relevant javadoc for more information.

Trait Implementations

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'a, T> Desc<'a, T> for T[src]