I need to re-launch an activity to re-load a static library. If I want to call some functions of the same static library my system fails. It only works with the first call, after it doesn’t find the correct symbols and fails with the next error:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000100
If I kill the process and launch the activity again, the static library is loaded again, since this moment, I can call the second function but if I want to call another third function of the library I have to repeat the same process to kill the process and launch the activity.
To kill the activity process I use the next command:
android.os.Process.killProcess(android.os.Process.myPid());
My method to kill and launch works but it isn’t useful, I think that it has to exist a better solution. Maybe I should remove and load the static library every time in the activity but I don’t know if it is posible, I’m a little lost.
Every activity has its own unique
process id, so i will suggest you to take a temporary activity which deals with your library.now your main activity will call
startActivityForResult(temporaryact)and in onDestroy() of temporary callandroid.os.Process.killProcess(android.os.Process.myPid());then in main activity
onAcitivityResult()call temporary activity again and so on.This worked for me, may you also away with it.