How to exchange data between renderscript and android framework?

☆樱花仙子☆ 提交于 2019-11-30 14:50:18
Fabien R

You have to use rsSendToClient(1, &data, sizeof(data)); in your script and decode the data in Java like this:

RSMessageHandler l_resHandler = new RSMessageHandler()
{
    @Override
    public void run()
    {
        switch (mID)
        {
            case 1:
            {
                // Handle mData 

            }
            break;
            default: super.run();
                break;
        }
    }

 };
 mRS.setMessageHandler(l_resHandler);

But I could not decode the value yet as I asked here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!