EDITED to reflect the change in the original question from Service to BroadcastReceiver .
Instead of using getPreferences(int mode) in Activity use ...
getSharedPreferences(String name, int mode).
The getPreferences(int mode) method is a convenience method for the above and simply passes the name of the Activity class as the name parameter. This means that it should really be used only for this Activity to store its own internal settings, and not for preferences that should be global for other components of the application.
In the case of BroadcastReceiver the onReceive(...) method is passed the Context parameter, so you can use context.getSharePreferences(<some_name>, <mode>) to get the SharedPreferences saved by the Activity .
source share