There are several good posts (eg this) instructing how to set this in AndroidManifest.xml.
However, I find that Xamarin (Visual Studio) automatically (re-)generates the AndroidManifest.xml file at build time, using the [Activity()]
attributes (== Properties > Android Manifest) to generate the manifest's <application>
tag+attribs.
Thus if you manually edit the AndroidManifest.xml to add the android:allowBackup
attrib, it will get lost upon rebuild.
Additionally, [Activity()]
doesn't support allowBackup
or fullBackupOnly
, so you can't set them them via that.
What's the solution to this?
How can I set android:allowBackup
in a way that survives rebuild?