Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97bbb533 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Fix up-navigation for different levels of Settings screens." into jb-dev

parents 25043553 3d384f4c
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -143,9 +143,11 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler {
            });
        }

        // TODO Add support for android.R.id.home in all Setting's onOptionsItemSelected
        // getActionBar().setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP,
        // ActionBar.DISPLAY_HOME_AS_UP);
        // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
        if (onIsMultiPane()) {
            getActionBar().setDisplayHomeAsUpEnabled(false);
            getActionBar().setHomeButtonEnabled(false);
        }
    }

    @Override
@@ -602,6 +604,10 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler {
        return true;
    }

    public boolean shouldUpRecreateTask(Intent targetIntent) {
        return super.shouldUpRecreateTask(new Intent(this, Settings.class));
    }

    @Override
    public void setListAdapter(ListAdapter adapter) {
        if (mHeaders == null) {
+6 −0
Original line number Diff line number Diff line
@@ -21,4 +21,10 @@ package com.android.settings;
 * since for our app it is a special singleTask class.
 */
public class SubSettings extends Settings {

    @Override
    public boolean onNavigateUp() {
        finish();
        return true;
    }
}