1

I have a Renderscript kernel to perform a long operation similar to the google sample. However, it is possible for users to cancel the request. Is there any API to terminate a pending Renderscript operation? How can i force renderscript to stop?

https://github.com/googlesamples/android-BasicRenderScript

Vairavan
  • 1,246
  • 1
  • 15
  • 19

1 Answers1

0

There's no direct call to cancel. It may work to call .destroy() on the RS context object which is bound to your script (the RenderScript object instance.)

Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33
  • My logic targets Neugut and above and destroy is documented to be a NOP. I tried using RenderScript.releaseAllContexts() from main thread but that just waits on a lock held by the task executing the actual script and locks up the UI until the script finishes. – Vairavan May 04 '18 at 15:10