Calling native method twice of third party library in an Activity causes the Android application to close down

前端 未结 2 1565
别跟我提以往
别跟我提以往 2020-11-28 09:17

I have integrated two native libraries (.so ) in my application. The libraries compile fine and I can load them in my application too. The first time I invoke a native metho

2条回答
  •  执念已碎
    2020-11-28 09:41

    So ... my solution was starting a service that runs the shared library code, this service has a different process name ( you can set it in the Android Manifest ), as it is a different process you can kill it ( Using Process.killProcess(Process.myPid()) when it finishes running, without affecting your application in any way.

    Worked very well for me, hope it helps someone else.

提交回复
热议问题