Problems restoring to multiple devices using Android BackupManager

戏子无情 提交于 2019-12-21 17:30:52

问题


I've implemented backup/restore of SharedPreferences using BackupManager as per the Android docs, but I'm having trouble restoring preferences to a second device. I believe the implementation is fine, since I can restore settings to a single device, i.e. if I run the app, make changes, uninstall and reinstall I get the modified preferences that I expect. However, if I subsequently install the app on a second device, I don't see the changes, even if I use the bmgr tool to force a backup on the first device and force a restore on the second device. Both devices have the same Google accounts, and both devices successfully restore their own backed up preferences on reinstall. I just can't get them to restore changes made from a different device.

If I install the app on a new device, I would expect it to restore the latest preferences, never mind from which device the backup was made. I've also set the android:restoreAnyVersion="true" flag, but that made no difference. What am I missing? If the devices use different transport services, could that cause the problem I'm seeing?

来源:https://stackoverflow.com/questions/9932372/problems-restoring-to-multiple-devices-using-android-backupmanager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!