1
我想知道在Mono for Android应用程序中使用静态变量作为业务实体的长期存储是否安全。Monodroid中的静态变量
举例来说,如果我有这个类:
public class Test{
public static int MyStaticVariable{get;set;}
}
,并在我的主要活动我有这样的代码
protected override void OnCreate(Bundle bundle)
{
...
if (Test.MyStaticVariable){
Test.MyStaticVariable=666;
}
}
我可以永远依靠Test.MyStaticVariable==666
或将这个值是最终被重置操作系统,当我的应用程序超出范围和内存必须回收?
感谢,
阿德里安