with the premise that I have NO EXPERIENCE of C language, I would like to solve a problem that does not allow me to proceed with the publication of my app.
I have a native function that uses ffmeg for file conversion, which I call from Android by AsyncTask.
I need to stop the native function, and tried in several ways:
1) I created a function "deleteRutine" in C which resets all the variables. (not working)
2) I added into function of converting a boolean variable, and I set it to false via a method from Android (not working)
What else can I try? Any advice?
As mentioned by rui.araujo, the second method should work if implemented properly.
The boolean value you are passing from Android to a native function, print it and check whether it is getting passed properly or not. Mostly there might be a problem in your JNI method implementation because of which you code flag is not being modified.
Your code should be something like this:
while(FLAG==true)
{
//Do Your task
}
return;
This should definitely work if implemented properly. I have used this in many similar situations.. If there is still some problem, edit your post and post the code snippet of the second implementation...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With