summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-10-07 18:33:13 -0700
committerAmith Yamasani <yamasani@google.com>2011-10-07 18:33:13 -0700
commit5c18ac651415ce71f8cb078a3ce9f5b5802d70ec (patch)
tree648dd1e3827af2ceceaca6ea97511c22143e559d /core/java/com
parentba8ecd206cc6f175767f952d380c88f70ece04cf (diff)
downloadframeworks_base-5c18ac651415ce71f8cb078a3ce9f5b5802d70ec.zip
frameworks_base-5c18ac651415ce71f8cb078a3ce9f5b5802d70ec.tar.gz
frameworks_base-5c18ac651415ce71f8cb078a3ce9f5b5802d70ec.tar.bz2
Save the click position and restore it on orientation change.
Bug: 5417556 Change-Id: I817890a3ff2910aa49ec44a30edb1a39d0d97095
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/app/RingtonePickerActivity.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/java/com/android/internal/app/RingtonePickerActivity.java b/core/java/com/android/internal/app/RingtonePickerActivity.java
index 719847e..36fc24e 100644
--- a/core/java/com/android/internal/app/RingtonePickerActivity.java
+++ b/core/java/com/android/internal/app/RingtonePickerActivity.java
@@ -47,7 +47,9 @@ public final class RingtonePickerActivity extends AlertActivity implements
private static final String TAG = "RingtonePickerActivity";
private static final int DELAY_MS_SELECTION_PLAYED = 300;
-
+
+ private static final String SAVE_CLICKED_POS = "clicked_pos";
+
private RingtoneManager mRingtoneManager;
private Cursor mCursor;
@@ -120,7 +122,10 @@ public final class RingtonePickerActivity extends AlertActivity implements
if (mUriForDefaultItem == null) {
mUriForDefaultItem = Settings.System.DEFAULT_RINGTONE_URI;
}
-
+
+ if (savedInstanceState != null) {
+ mClickedPos = savedInstanceState.getInt(SAVE_CLICKED_POS, -1);
+ }
// Get whether to show the 'Silent' item
mHasSilentItem = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
@@ -167,6 +172,12 @@ public final class RingtonePickerActivity extends AlertActivity implements
setupAlert();
}
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt(SAVE_CLICKED_POS, mClickedPos);
+ }
+
public void onPrepareListView(ListView listView) {
if (mHasDefaultItem) {