You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling ns::android::showToast from main will cause crash with exception : "Can't toast on a thread that has not called Looper.prepare()" (here). This happens because the main thread looper is not found (I think ?) when creating the Toast message.
Attempted to use the ALooper solution with no success because we don't have access to the main thread from the SFML Activity unfortunately.
In fact, SFML sets the looper from initializeMain which is called from the custom android main, which itself is ran in new thread.
Possible Solution : access main looper from Java's static method Looper.getMainLooper and then make the JNI showToaster call from there.
The other solution would be to completely replace sfml-activity by nasnas-activity and call ALooper_prepare from the activity main thread, and setup a pipe to communicate with it.
The text was updated successfully, but these errors were encountered:
Calling
ns::android::showToast
from main will cause crash with exception :"Can't toast on a thread that has not called Looper.prepare()"
(here). This happens because the main thread looper is not found (I think ?) when creating the Toast message.Attempted to use the ALooper solution with no success because we don't have access to the main thread from the SFML Activity unfortunately.
In fact, SFML sets the looper from initializeMain which is called from the custom android main, which itself is ran in new thread.
Possible Solution : access main looper from Java's static method
Looper.getMainLooper
and then make the JNI showToaster call from there.The other solution would be to completely replace sfml-activity by nasnas-activity and call ALooper_prepare from the activity main thread, and setup a pipe to communicate with it.
The text was updated successfully, but these errors were encountered: