Android global variable

前端 未结 14 1117
眼角桃花
眼角桃花 2020-11-21 23:32

How can I create global variable keep remain values around the life cycle of the application regardless which activity running.

14条回答
  •  梦谈多话
    2020-11-22 00:03

    If possible, you should declare the variables that you need to keep alive that haven't been clear by Garbage Collector or Unload by OS in file .so To do it, you must code by C/C++ and compile to .so lib file and load it in your MainActivity.

提交回复
热议问题