Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我从 Application 类扩展并创建一个存储我的数据上下文的单例类(带有发票的用户、带有文章的发票、带有价格的文章……)。当应用程序处于活动状态时,这个“上下文”变量是否可用?此存储的内存大小是否有最大限制?
是的,它将可用,您将能够通过以下方式获得它:
YourObject obj = getApplication ().someMethod (); YourObject obj2 = getApplication ().publicObject;