Are shared preferences shared with users

I have a question, kindly help me by following my questions?

  • Are general preference data available to users?

  • Also, can we have the same widget identifiers for two different users?

  • I have a widget that any user can use. I have something conflicts when switching a guest user or any new user. In particular , my widget resizes and saves its state so that it can be inflated accordingly when the phone reboots or some update events. They work fine for the admin user, but he behaves abnormally when a guest is added or the user is switched.

+4
source share
1 answer

Yes, general preference data is shared between users, if we define CONTEXT MODE when creating SahredPreference for more details, you can read here for more details, and here. For the widget id, I think we can provide the same id for different users, but here (I'm not sure) there should also be a concept of mode.

0
source

Source: https://habr.com/ru/post/1665577/


All Articles