Fix bug #13300024 Settings app crashes on changing device orientation
- remove crashing code. Basically let the Framework do its work. No need to save the state of the EditText by ourselves. Change-Id: I49e98a852f4fcda61eabaa2967d027942905ec27
This commit is contained in:
@@ -40,8 +40,6 @@ import com.android.settings.indexer.Index;
|
||||
|
||||
public class DashboardSummary extends Fragment {
|
||||
|
||||
private static final String SAVE_KEY_QUERY = ":settings:query";
|
||||
|
||||
private EditText mEditText;
|
||||
private ListView mListView;
|
||||
|
||||
@@ -90,26 +88,6 @@ public class DashboardSummary extends Fragment {
|
||||
updateSearchResults();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
if (outState != null) {
|
||||
outState.putString(SAVE_KEY_QUERY, mEditText.getText().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
final String query = savedInstanceState.getString(SAVE_KEY_QUERY);
|
||||
if (query != null && !TextUtils.isEmpty(query)) {
|
||||
mEditText.setText(query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
Reference in New Issue
Block a user