我在一个 apk 中有两个独立的 Android Activity 。 这两个 Activity 都加载一个source.so 文件。 我的问题是,对于生成 .so 文件的 c 文件中的全局变量 int c; ,这个 int c 是否在这两个 Activity 之间共享? 如果改为两个应用程序而不是两个 Activity,情况会有所不同吗?
最佳答案
is this int c shared between these two activities?
应该是的。该变量对于您的流程来说将是全局的。
And will the things be different if it changes to two applications rather than two activities?
是的,因为两个应用程序通常在单独的进程中运行。
关于android - 在android apk中的不同 Activity 中加载.so文件时的内存共享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16043375/