How do I post code to be run on the Android main thread from a separate thread in C++?

后端 未结 5 1358
我寻月下人不归
我寻月下人不归 2021-01-07 17:55

I have a separate thread running in C++ in the background and I want it to be able to post code to be run on another thread that\'s already running an android.os.Looper (e.g

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-07 18:23

    This could help you https://groups.google.com/forum/#!topic/android-ndk/v2OITtaZTes

    But it is easy to achieve through a handler on the java side, sending and processing messages doing back and forth between native and java with jni calls.

提交回复
热议问题