Android - Shared-preferences in Broadcast
问题 In my BroadcastReceiver class I am using ISharedPreferences to store a string coming from a service and compare it with the previous string (which is stored in my Preferences). BroadcastReceiver.cs [BroadcastReceiver] [IntentFilter(new[] { "TEST" })] public class Receiver : BroadcastReceiver { public override void OnReceive(Context context, Intent intent) { ISharedPreferences pref = PreferenceManager.GetDefaultSharedPreferences(context); ISharedPreferencesEditor editor = pref.Edit(); string