SharedPreference committed in SyncAdapter not updated in Activity?

后端 未结 3 1121
日久生厌
日久生厌 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:34

    Since the SharedPreferences are not process-safe, i wouldn't recommend to use the AbstractThreadedSyncAdapter in another process unless you really need it.

    Why do i need multiple processes in my application?

    Solution

    Remove android:process=":sync" from the Service that you declared in your manifest!

    
        
            
        
        
    
    

提交回复
热议问题