Manifest:
<application
android:fullBackupContent="@xml/backup_rules"
tools:replace="android:fullBackupContent">
Also I try this variant:
<application
android:fullBackupContent="@xml/backup_rules"
tools:replace="android:fullBackupContent"
android:allowBackup="true"
android:fullBackupOnly="true">
Backup_rules:
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="file" path="."/>
<include domain="database" path="."/>
<include domain="sharedpref" path="."/>
<include domain="external" path="."/>
<include domain="root" path="."/>
<exclude domain="sharedpref" path="EXPONEA_PUSH_TOKEN.xml"/>
</full-backup-content>
The problem is that I try to save string to shared preference and get it after re-installing the app, but something went wrong.
For example:
val namePreferences: SharedPreferences = getSharedPreferences("name", Context.MODE_PRIVATE)
namePreferences.edit().putString("name_test", user.name).apply()
val test = namePreferences.getString("name_test", "empty name")
//here test isn't empty
When I re-installing my app:
val test = namePreferences.getString("name_test", "empty name")
//here test is empty ("empty_name")