NativeActivity is destroyed when a USB device is attached or detached. #2055
-
|
As the title suggests, is there any solution or workaround for when this happens? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Maybe another user listening here knows an answer, but if you want a fix you probably need to file an OS bug. One thing you might try would be switching to |
Beta Was this translation helpful? Give feedback.
-
|
do you have a suggested improvement to the (i'm assuming that the fix you'd suggest to the |
Beta Was this translation helpful? Give feedback.
So I decided to try the ndk samples to see if they were affected too, turns out they weren't so it was clear I was doing something wrong. It turns out I was confused on what
destroyRequestedis supposed to signal and thought theandroid_mainfunction will only be called once by theNativeActivity, so I never let the app thread exit when it should have. In hindsight it makes total sense thatandroid_mainwill be called every time theNativeActivityis destroyed and remade.Thank you for taking the time to reply.