Exchange of preferences between activity and service

I have an .apk which has Serviceand Activitywhich I want to share with my preferences. I think I'm using this getSharedPreferences("somename", MODE_PRIVATE). A few questions:

  • Is it MODE_PRIVATEOK? Does this mean that it is personal to the application or Activity / Service?

  • I have one PreferenceActivity. How can I say that to control "somename" instead of the default settings?

Thank!

+3
source share
1 answer

MODE_PRIVATE: : , ( ). , MODE_PRIVATE .

, ( ) , .

+4

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


All Articles