可以在同一个应用程序中使用 getDefaultSharedPreferences 和 getSharedPreferences(nome,mode) 吗?

One can use getDefaultSharedPreferences and getSharedPreferences(nome,mode) in the same app?

我正在维护一个使用共享首选项的应用程序。

常规设置从 getDefaultSharedPreferences 获取。我想使用 getSharedPreferences 存储另一组偏好(用户会话信息,与其他设置完全无关)。

如果我这样做,是否有可能一个人对另一个人造成干扰?

If I do that, there's any chance of one cause interference on another?

不,没有这样的事情。它们存储在两个不同的 xml 文件中(除非您幸运地猜到了默认名称 context.getPackageName() + "_preferences")。