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
If you want to make some stuffs in the main thread from another thread, I suggest you to use the runOnUiThread function. The main thread in Android is the User Interface thread. I'm not sure if you can use this function in the ndk code.
An example of code could be this:
private void runOnMainThread() {
runOnUiThread(new Runnable(){ public void run() { try { // do some stuffs } catch (final Exception ex) { // handle the possible exception } } }); }
Anyway I suggest you to read the follow links: link1, link2, link3.
I hope it helps.