Example usage for android.app.backup SharedPreferencesBackupHelper SharedPreferencesBackupHelper

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

Introduction

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

Prototype

public SharedPreferencesBackupHelper(Context context, String... prefGroups) 

Source Link

Document

Construct a helper for backing up and restoring the android.content.SharedPreferences under the given names.

Usage

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

/**
 * {@inheritDoc}/* w ww. j av  a2 s .c o  m*/
 */
@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);
}