سؤال

Just a quick question, and probably a stupid one so apologies.

Is it possible to have several SharedPreference files, for example:

getSharedPreferences('cakes', MODE_PRIVATE);
getSharedPreferences('tarts', MODE_PRIVATE);
getSharedPreferences('pies', MODE_PRIVATE);
getSharedPreferences('meringues', MODE_PRIVATE);

... and so on...

Is there a limit; or can the above even be achieved?

Thanks in advance for any help!

هل كانت مفيدة؟

المحلول

Yes, you can multiple shared preference files. You could, for instance, use a different file for every user if you support user sessions.

نصائح أخرى

You can have many of those. The limit is very high - it basically creates a new file for every one. But there is no reason for doing that.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top