The docs state that :
Gets a SharedPreferences instance that points to the default file that is used by the preference framework in the given context.
My question is a context related question really - I am not quite clear if the context received by a BroadcastReceiver (in myapp.receivers
package), the context I get in some activity or service (in myapp.activities
and myapp.services
respectively) will delegate to the same SharedPreferences instance.
Note that behind the scenes getDefaultSharedPreferences(context)
calls getSharedPreferences(context.getPackageName(), MODE_PRIVATE)
.
Btw it is also reported that starting an app from shortcut as opposed to menu gives different Default Preferences