jeudi 14 juillet 2016

sharedPreferences wont update if edited in another process

I have an unity activity, which launches in another process than my App:

  <activity
        android:name=".UnityActivity"
        android:process=":UnityKillsMe"/>

I save my sharedPreferences encrypted with this question(just in case this affects my problem and I have no idea) now if I want to edit a sharedPreference in process=":UnityKillsMe", the edits are not beeing accessable in mainProcess, it just takes the old version of the sharedPreferences. Not until I kill the mainProcess and launch the app again. If I do not kill the mainProcess, and edit the sharedPreferences, while they have been edited in process=":UnityKillsMe", the edits will be overwritten, and are lost. how do I refresh sharedPreferences in the main process ?

Aucun commentaire:

Enregistrer un commentaire