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.
嗨,我正在学习 Android 开发。我的查询是当我从 AccountManager Android 获取“writely”谷歌文档的访问令牌时。我应该在哪里保存 authtoken?我正在为 API 7 开发。
你真的不需要保存它。AccountManager自动缓存令牌,因此当您调用getAuthToken(). 不过,您应该能够处理令牌过期的情况。如果你真的想保存它,SharedPreferences 是自然而然的地方。
AccountManager
getAuthToken()