diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index 0691bcc1e8..09c1b969bd 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -595,7 +595,7 @@ impl Window { if let Some(native_window) = ndk_glue::native_window().as_ref() { handle.a_native_window = unsafe { native_window.ptr().as_mut() as *mut _ as *mut _ } } else { - panic!("Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events."); + log::warn!("Cannot get the native window while the application is suspended (between Event::Suspended and Event::Resumed)."); }; RawWindowHandle::AndroidNdk(handle) } diff --git a/src/window.rs b/src/window.rs index 59c8c59f2e..5c55378d20 100644 --- a/src/window.rs +++ b/src/window.rs @@ -889,8 +889,7 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window { /// /// ## Platform-specific /// - /// - **Android:** Only available after receiving the Resumed event and before Suspended. *If you* - /// *try to get the handle outside of that period, this function will panic*! + /// - **Android:** Not available between receiving the Suspended and Resumed events. fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle { self.window.raw_window_handle() }