Merge "Save the click position and restore it on orientation change."
This commit is contained in:
committed by
Android (Google) Code Review
commit
fbb602fe1f
@@ -48,6 +48,8 @@ public final class RingtonePickerActivity extends AlertActivity implements
|
|||||||
|
|
||||||
private static final int DELAY_MS_SELECTION_PLAYED = 300;
|
private static final int DELAY_MS_SELECTION_PLAYED = 300;
|
||||||
|
|
||||||
|
private static final String SAVE_CLICKED_POS = "clicked_pos";
|
||||||
|
|
||||||
private RingtoneManager mRingtoneManager;
|
private RingtoneManager mRingtoneManager;
|
||||||
|
|
||||||
private Cursor mCursor;
|
private Cursor mCursor;
|
||||||
@@ -121,6 +123,9 @@ public final class RingtonePickerActivity extends AlertActivity implements
|
|||||||
mUriForDefaultItem = Settings.System.DEFAULT_RINGTONE_URI;
|
mUriForDefaultItem = Settings.System.DEFAULT_RINGTONE_URI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (savedInstanceState != null) {
|
||||||
|
mClickedPos = savedInstanceState.getInt(SAVE_CLICKED_POS, -1);
|
||||||
|
}
|
||||||
// Get whether to show the 'Silent' item
|
// Get whether to show the 'Silent' item
|
||||||
mHasSilentItem = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
|
mHasSilentItem = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
|
||||||
|
|
||||||
@@ -167,6 +172,12 @@ public final class RingtonePickerActivity extends AlertActivity implements
|
|||||||
setupAlert();
|
setupAlert();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
outState.putInt(SAVE_CLICKED_POS, mClickedPos);
|
||||||
|
}
|
||||||
|
|
||||||
public void onPrepareListView(ListView listView) {
|
public void onPrepareListView(ListView listView) {
|
||||||
|
|
||||||
if (mHasDefaultItem) {
|
if (mHasDefaultItem) {
|
||||||
|
|||||||
Reference in New Issue
Block a user