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.
我使用一些凭据登录到应用程序,并且该用户有一些通过 Web 服务下载的数据。问题是,当我在退出后使用其他凭据登录(不退出应用程序)时,有时我会得到以前用户的数据。谁能告诉可能是什么问题。当我注销删除与以前用户相关的数据时,我该怎么办。
如果您的数据存储在ArrayList中,那么当一个用户“退出”时,您可以调用clear()方法来清除您的内存。
与HashMap类似,它也有clear()方法。