[−][src]Struct android_ndk::native_activity::NativeActivity
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
impl Send for NativeActivity[src]
impl Sync for NativeActivity[src]
Auto Trait Implementations
impl Unpin for NativeActivity
impl UnwindSafe for NativeActivity
impl RefUnwindSafe for NativeActivity
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,