From cdcc28a9cb49a6cf06b84130df29dae58fbceaad Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Tue, 16 Nov 2010 15:41:27 -0800 Subject: [PATCH] Add self-restore capability to Backup/Restore sample app The Backup/Restore sample application now provides a "restore my own last-known-good data" button. When it is clicked the app will run the standard public BackupManager.requestRestore() operation. (This was the one aspect of the public API that was not previously exercised by the sample app.) Change-Id: I8abcfbad4b27b35fe9fafbbb97f89bac1d7a668c --- samples/BackupRestore/Android.mk | 2 + samples/BackupRestore/proguard.flags | 3 + .../res/layout/backup_restore.xml | 98 +++++++++++-------- samples/BackupRestore/res/values/strings.xml | 2 + .../backuprestore/BackupRestoreActivity.java | 21 +++- 5 files changed, 83 insertions(+), 43 deletions(-) create mode 100644 samples/BackupRestore/proguard.flags diff --git a/samples/BackupRestore/Android.mk b/samples/BackupRestore/Android.mk index c164a6c0b..abe2526be 100644 --- a/samples/BackupRestore/Android.mk +++ b/samples/BackupRestore/Android.mk @@ -10,4 +10,6 @@ LOCAL_PACKAGE_NAME := BackupRestore LOCAL_SDK_VERSION := current +LOCAL_PROGUARD_FLAG_FILES := proguard.flags + include $(BUILD_PACKAGE) diff --git a/samples/BackupRestore/proguard.flags b/samples/BackupRestore/proguard.flags new file mode 100644 index 000000000..f487abc52 --- /dev/null +++ b/samples/BackupRestore/proguard.flags @@ -0,0 +1,3 @@ +-keepclassmembers class com.example.android.backuprestore.BackupRestoreActivity { + public void onRestoreButtonClick(android.view.View); +} diff --git a/samples/BackupRestore/res/layout/backup_restore.xml b/samples/BackupRestore/res/layout/backup_restore.xml index 1459d4216..9e61b00ce 100644 --- a/samples/BackupRestore/res/layout/backup_restore.xml +++ b/samples/BackupRestore/res/layout/backup_restore.xml @@ -16,58 +16,72 @@ - - + android:layout_width="match_parent" + android:layout_height="wrap_content"> - + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:layout_weight="1"> - + android:layout_height="wrap_content"> - + - - - + - + + + - + - + - + - + - \ No newline at end of file + + + + +