BackupAgent doing nothing

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.


属性android:backupAgent需要一个完全限定的类名或一个句点(它被追加到元素中指定的包名称中),正如这里指定的那样!

链接地址: http://www.djcxy.com/p/25482.html

上一篇: onRestore不会为我的自定义BackupAgent调用

下一篇: BackupAgent无所事事