mirror of
https://github.com/jwinterm/grim.git
synced 2026-11-25 07:13:54 +01:00
android: update activity lib, optimize app exit
This commit is contained in:
@@ -74,15 +74,4 @@ impl PlatformCallbacks for Android {
|
||||
};
|
||||
paste_data
|
||||
}
|
||||
|
||||
fn exit(&self) {
|
||||
use jni::objects::{JObject};
|
||||
|
||||
let vm = unsafe { jni::JavaVM::from_raw(self.android_app.vm_as_ptr() as _) }.unwrap();
|
||||
let mut env = vm.attach_current_thread().unwrap();
|
||||
let activity = unsafe {
|
||||
JObject::from_raw(self.android_app.activity_as_ptr() as jni::sys::jobject)
|
||||
};
|
||||
env.call_method(activity, "onExit", "()V", &[]).unwrap();
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,4 @@ impl PlatformCallbacks for Desktop {
|
||||
fn get_string_from_buffer(&self) -> String {
|
||||
"".to_string()
|
||||
}
|
||||
|
||||
fn exit(&self) {}
|
||||
}
|
||||
|
||||
@@ -26,5 +26,4 @@ pub trait PlatformCallbacks {
|
||||
fn hide_keyboard(&self);
|
||||
fn copy_string_to_buffer(&self, data: String);
|
||||
fn get_string_from_buffer(&self) -> String;
|
||||
fn exit(&self);
|
||||
}
|
||||
Reference in New Issue
Block a user