Example usage for android.app.backup FileBackupHelper FileBackupHelper

List of usage examples for android.app.backup FileBackupHelper FileBackupHelper

Introduction

In this page you can find the example usage for android.app.backup FileBackupHelper FileBackupHelper.

Prototype

public FileBackupHelper(Context context, String... files) 

Source Link

Document

Construct a helper to manage backup/restore of entire files within the application's data directory hierarchy.

Usage

From source file:uk.org.rivernile.edinburghbustracker.android.SettingsBackupAgent.java

/**
 * {@inheritDoc}//w w  w . ja va  2  s  .c  om
 */
@Override
public void onCreate() {
    // We can use an inbuilt helper to deal with the SharedPreferences for
    // us.
    SharedPreferencesBackupHelper prefsHelper = new SharedPreferencesBackupHelper(this,
            PreferencesActivity.PREF_FILE);
    addHelper(PREFS_BACKUP_KEY, prefsHelper);

    // Use the FileBackupHelper to deal with the favourite stops.
    FileBackupHelper favsHelper = new FileBackupHelper(this, "settings.backup");
    addHelper(FAVS_BACKUP_KEY, favsHelper);
}