문제

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.

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top