SharedPreference committed in SyncAdapter not updated in Activity?

后端 未结 3 1103
日久生厌
日久生厌 2021-02-19 06:35

I am changing and committing a SharedPreference in my SyncAdapter after successful sync, but I am not seeing the updated value when I access the preference in my Activity (rathe

3条回答
  •  灰色年华
    2021-02-19 07:22

    In my case I was trying to access SharedPreferences from a service launched by a BroadcastReceiver.

    I removed android:process=":remote" from the declaration in the AndroidManifest.xml to get it to work.

    
    
    

提交回复
热议问题