语言

Menu
Sites
Language
Global Variable

Hi all,

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

Thank you.

响应

2 回复
Jean Yang

Hello, 

You can put it in  appdata(create a sample), and initialize it.

Vikram

Hi,

An alternate way, you can just declare the variable as extern in .h file, and include the .h file in the source file which you need to access this variable.