Question

Manifest:

<manfiest package="com.backme"  ... />
    <application android:backupAgent="PrefsBackupAgent" .../>
<meta-data
            android:name="com.google.android.backup.api_key"
            android:value="12345...." />

Code:

public class PrefsBackupAgent extends BackupAgentHelper {
    @Override
    public void onCreate() {
        Log.d("PrefsBackupAgent","Backingup");
        SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PlacesConstants.SHARED_PREFERENCE_FILE);
        addHelper(PlacesConstants.SP_KEY_FOLLOW_LOCATION_CHANGES, helper);
    }
}

Does it matter that my PrefsBackupAgent is not at the top level of com.backme but at com.backme.utils ? And FYI, I'm not seeing the "Backingup" in the logs.

Was it helpful?

Solution

The attribute android:backupAgent requires a fully qualified class name or a period (it is appended to the package name specified in the element) as specified here!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top